Closed verdy-p closed 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.
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:
%2
that is not effectively passed by the application: it should work by either keeping %2
unchanged, or replacing it by an empty string. (IMHO this is where the "syntax error" occurs in the Translatewikinet implementation, possibly because it uses a non-working regular expression that does not work when the string "%2" to replace was expected in the translated message, according to the base message){{PLURAL:requiredvalue|textualforms...}}
should also not generate any fatal error if the effective given requiredvalue (after possible replacement of placeholders) is not a valid number or is an empty string: it should just return the last given textualform, and it may generate a background debugging log about this missing or invalid number like "" or "%2" (it is possible that in TWN the form {{PLURAL:%99|}}
causes the same "syntax error" because this "%99" is not a valid number, but that error is avoided when the textual forms are empty because the whole {{PLURAL:anything|textualform}}
can be safely be replaced without evaluating the number if there's a single textual form given).Wow, it works, thank you.
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
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):(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
(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.)