-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
Python format check not applied to some plural forms #9682
Comments
Actually, I do not know what can be added here. It is hard to tackle with languages with many plural forms. It is allowed to skip %d for singular but I do not know how to treat this for dual and other forms in Arabic. It should be inspected by Weblate developers. |
Sorry, I meant the details the bug template asks about deployment (versions, deploy checks). But maybe that does not matter? |
Weblate allows omitting the format string when there is only a single value for the plural form. So for Arabic, it is okay to have six plurals as:
This is inconsistent with |
Thank you, that answers why this happens. I suppose there is no way to adjust this on a component level? Is this check done by something that I can swap with using msgfmt? I found |
In some cases it might be desired to have them. See WeblateOrg#9682
I've just implemented flag to enforce such format strings in #9695 The Weblate checks are not easy to isolate because they depend on the database. You can use enforced checks in Weblate to make sure that no broken strings are committed as translations, see https://docs.weblate.org/en/latest/admin/projects.html#enforced-checks |
In some cases it might be desired to have them. See #9682
Thank you for your report; the issue you have reported has just been fixed.
|
Thank you! That was unexpected... I was looking at msgfmt instead, trying to see if I could make the relaxed mode for plurals an option there. Perhaps that would be a more reasonable thing in context of the whole ecosystem - as you say, many other parts allow this, and for some format kinds it's technically sound to omit things. |
Describe the issue
Hello, I have a source string which is a plural using python format (the percent kind). In weblate, I have turned on "python format" as a mandatory check. Somebody just translated the string, and did not use the percent format. There is nothing shown on the string page indicating this is a problem, and this translation is pushed into the repository.
Detailed information below.
I already tried
Steps to reproduce the behavior
Flags: python-format
, lack of %d in some of the translation plurals, but no related warning or error.Expected behavior
There should be some indication that the check failed.
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
Other
Weblate versions
@yurchor can you please fill in the missing parts?
Weblate deploy checks
No response
Additional context
Detailed information:
anaconda
, componentrhel-9
: singular%d _storage device selected
, plural%d _storage devices selected
python-format
in flags, and highlights the%d
.msgfmt -c
, it detects correctly that this particular string's translation is wrong.The text was updated successfully, but these errors were encountered: