-
-
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
Android lint errors when cs/fr/lt/sk are missing "many" in plurals, Weblate does not #7520
Comments
This definitely was not the case in the past, what has changed in Android regarding this? Weblate uses CLDR data for Android. The |
I'm not sure exactly when it changed, it could have been a while ago since I haven't been too active working on Android things recently. Here's the lint check code: |
It was introduced in https://cs.android.com/android-studio/platform/tools/base/+/97f96e70464579c01712dec78bb398d2e47582df, unfortunately the commit does not include any reasoning... |
Weblate certainly could be changed to deal with non-integer plurals. On the other side, most of the applications don't really need this, and it would add one additional string to translate (and confuse translators because they are currently not used to this). |
I have no opinion of whether it is needed or not. I'm just reporting that
Android is calling it a requirement, and they added a _lint_ check to enforce it.
|
This issue has been put aside. It is currently unclear if it will ever be implemented as it seems to cover too narrow of a use case or doesn't seem to fit into Weblate. Please try to clarify the use case or consider proposing something more generic to make it useful to more users. |
So here's more info on the use case:
* Dev who does not know anything about ca/fr/lt/sk puts their Android app
on Weblate.
* Dev sets up standard Android _lint_ checks since the include important checks
to prevent crashes due to incomplete translations.
* Dev has no idea what "many" plurals are, and wonders why _lint_ is failing.
* Dev has no idea how to fix it, so disables _lint_ or uses different
translation service.
|
maybe make it configurable in weblate what kind of different plurals it exists for each language? |
The plural rules are currently detected based on the file. Some formats do explicitly include it (Gettext), for others we do guess what should be used (what turns out to be tricky, see for example translate/translate#786). Having that user configurable would be possible, but I'm uncertain if it will address the issue - the choice here is between Android lint complains and translators having extra work which is not needed in most cases. Anyway, it's safe to assume that most people will not change the configuration :-). |
As far as I know, the lint rules are not configurable beyond enable/disable
across the project. I don't think that Weblate should be configurable for the
Android strings.xml unless Android itself is.
Do you think this could be a bug in Android lint? If so, I'm happy to report
it, but I don't know the details of CLDR and things like that.
|
Apparently, it was intentional change there. Knowing the reasons might help us understand that as well... |
Based on the info here, my guess is that they added support for
|
Yes, it makes grammatical sense when you need decimals. The problem is that you don't need them in numerous instances. In this case, you won't have two and half adults, as you usually don't cut them ;-). Anyway, to support this in Weblate:
|
@samofcorinth could you explain the reasoning behind change from |
Android Lint gets its plural data from this page: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html#fr |
These added exponent based conditions to several languages. See WeblateOrg/weblate#7520
We will need these to properly handle changes in Android / CLDR. See #7520
French seems a bit different here - there is an additional For cs/lt/sk the issue is described above - it affects decimal numbers only. |
I've split out #7888 to handle CLDR 38+ plural changes. |
This will be needed to implement support for recent Android extensions, see WeblateOrg/weblate#7520
Describe the issue
Android's lint tool is complaining about missing "many" entries in plural strings for "cs" (Czech), "fr" (French) , "lt" (Lithuanian), and "sk" (Slovak). The Weblate interface does not offer "many" as an option for those languages/strings. For example:
https://gitlab.com/grote/fdroidclient/-/jobs/2351872888
This is related to #1550. This site seems to say it is a matter of conversion between the CLDR and gettext representation schemes for plurals:
https://github.com/miracle2k/android2po#plurals-support
I already tried
Steps to reproduce the behavior
These are some of the strings:
Expected behavior
Weblate should support the "many" field for Android strings.xml for cs/fr/lt/sk languages.
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
weblate.org service
Weblate versions
No response
Weblate deploy checks
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: