-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
%% is not properly escaped in the java-printf-format check #13300
Comments
Thank you for your report; the issue you have reported has just been fixed.
|
The fix has resulted in just '%' (e.g. '%s', '%1$s') being escaped on Weblate UI Related but things like quotation marks are also being escaped alongside letters being removed |
@AntsyLich Thanks for reporting! I can also confirm this issue: https://hosted.weblate.org/translate/fossify/sms-messenger/pl/?checksum=3919ddcf6c6496f5 I was worried all Fossify translations might be currupted but thankfully @Aga-C found this issue. |
Thas seems unrelated to this issue, it seems issue in the Android strings parser. |
Thanks for clarifying |
Issue was described in WeblateOrg/weblate#13300
translate/translate#5450 should fix this. |
Seems to be fixed now 🎉 |
Describe the issue
The
java-printf-format
check checks whether the source and translation strings have the same number of format arguments. But,%%
escapes the%
character in Java format strings. Therefore,foo
andbar %%s
have the same number of format specifiers because the%
character before thes
is escaped by another%
character before it.However,
%%
is not recognized as a formatting code (which is later filtered out), and therefore it finds the%s
at the end ofbar %%s
and thinks it is a formatting code which is wrong.I already tried
Steps to reproduce the behavior
java-printf-format
check in a component (or project, or globally)%%s
into the translation field somewhereExpected behavior
Even though it's a bit weird to see strings like
%%s
in the translation and not source string, this particular check should not triggerScreenshots
Exception traceback
No response
How do you run Weblate?
Docker container
Weblate versions
Weblate deploy checks
Additional context
No response
The text was updated successfully, but these errors were encountered: