-
-
Notifications
You must be signed in to change notification settings - Fork 959
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
Java Format check fails for out of order parameters #5033
Comments
This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you! |
Your format strings are wrong - these do not allow reordering, the number defines minimal width of the string. You should be using |
TIL what the $ is for. I've always (wrongly) assumed the numbers are for the position. I'm going to close this then. Just a small side question, is it possible for the error message to be a bit more precise in this case (missing format args=extra format args)? |
The issue you have reported is resolved now. If you don’t feel it’s right, please follow it’s labels to get a clue and take further steps.
|
Describe the bug
I use Weblate to translate my Android app.
In texts with positional arguments (%1s, %2s, ...) the
Java Format
check fails when the order in which they appear is not the same as in the source string.An example source is
The quick brown %1s jumps over the lazy %2s with %3s
, an example (and valid) target could beDer träge %2s wird vom %1s mit einem %3s übersprungen
. It would result in the following error:Expected behavior
I'm not exactly sure whether this is worth fixing or not. In some cases the check would help catch formatted strings which are unintentionally out of order, however there are some languages where they are always going to be out of order.
I'll leave that up to you to decide. I can simply dismiss the error where applicable.
Server configuration and status
Weblate installation: Docker, version 4.3.2
The text was updated successfully, but these errors were encountered: