kanasimi / CeJS

The project aims to develop a JavaScript module framework that is simple to use with some interesting features. 本計畫目標是建立一個簡單上手的 JavaScript 模組架構。
Other
59 stars 12 forks source link

Translation issue with message Wikimedia:Cejs-total-$1-pages-redirected-to-this-page/fr #26

Closed verdy-p closed 2 years ago

verdy-p commented 2 years ago

URL: https://translatewiki.net/w/i.php?title=Special:Translate&showMessage=cejs-total-%241-pages-redirected-to-this-page&group=cejs&language=fr

This source message in English says

"Total %1 {{PLURAL:%2|page|pages}} redirected to this page"

Is that accurate? %1 may eventually contain a preformated number with group separators and localized digits, while %2 would be the raw integer without group separators and using only raw ASCII digits (in a form that PLURAL can process). But I doubt this is the case: please confirm and document it if this is the case.

Otherwise this message should most probably be (with only one parameter in %1, containing a raw integer without any groupe separator and most probably only non-localized digits from ASCII):

"Total %1 {{PLURAL:%1|page|pages}} redirected to this page"

(localizing numbers with national digits and group separators is a good idea for messages intended to be displayed in the UI for human end users, but not needed for purely technical messages such as tracing/debugging logs which are usually not translated and kept in English for posible automated processing and because developers using these logs may not know all translated languages or could reinterpret them incorrectly if they just decipher them partly or need to use some automatic translation tool to read support requests; a few developer teams however accept translated logs in their support and don't use automated tools to process support requests)

For now, I have translated it as if the message was

"Total %1 {{PLURAL:%1|page|pages}}{{PLURAL:%2|}} redirected to this page"

(i.e. with a reference of %2 in an empty plural form, as Translatewiki.net wants its presence in the translated message; but if you update the source, this dummy {{PLURAL:%2|}} will need to be removed; if you make any update anyway, all existing translations using %2 will become fuzzy and will need to be updated by translators.)

kanasimi commented 2 years ago

Thank you for your help in checking, I have modified the source code. I don't know why, but I got error message "Translation contains syntax errors" when I was fixing this, can you help me to solve this problem? Thank you.

verdy-p commented 2 years ago

I see the "syntax error" too when editing the "/en" page. This is probably an unrelated bug coming from Translatewiki.net itself, because the base translation still contains "%1" and "%2", and the attempt to remove "%2" completely causes this issue.

Proof: if I insert the dummy {{PLURAL:%2|}} in "/en" or "/fr", there's no such "syntax error" generated, and the edit is accepted.

"Total %1 {{PLURAL:%1|page|pages}}{{PLURAL:%2|}} redirected to this page"

So we need to open a separate bug for Translatewiki.net.

For now, we can still use this dummy {{PLURAL:%2|}} in edited translations, but I don't see why this would cause an error later when you update the source to remove it; and then the translations will be marked fuzzy, where the dummy {{PLURAL:%2|}} is present or not, or where {{PLURAL:%2|page|pages}} has not been edited and changed to {{PLURAL:%1|page|pages}}.

Note:

kanasimi commented 2 years ago

Wow, it works, thank you.