WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.5k stars 993 forks source link

"Other" not shown for Serbian Android strings #9364

Open eighthave opened 1 year ago

eighthave commented 1 year ago

Describe the issue

https://hosted.weblate.org/translate/f-droid/f-droid/sr/?q=button_view_all_apps_in_category&sort_by=-priority%2Cposition shows "one", "few", and "many". But using this string in Android causes a crash because "other" is missing:

org.fdroid.fdroid.LocalizationTest > testLoadAllPlural[ci_test(AVD) - 6.0] FAILED
    java.lang.IllegalArgumentException: Bad 'null' format in sr button_view_all_apps_in_category: Plural resource ID #0x7f100000 quantity=0 item=other
    at org.fdroid.fdroid.LocalizationTest.testLoadAllPlural(LocalizationTest.java:128)

This might be related to #1550

I already tried

Steps to reproduce the behavior

https://hosted.weblate.org/translate/f-droid/f-droid/sr/?q=button_view_all_apps_in_category&sort_by=-priority%2Cposition&checksum=

Expected behavior

There should be "other" strings in the Weblate UI when editing plurals in Serbian.

Screenshots

Screenshot from 2023-06-07 22-14-11

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

nijel commented 1 year ago

It has three plurals, and it should save it as other to the file. But there seems to be issue with labelling it in the UI.

nijel commented 1 year ago

This is yet another incarnation of https://github.com/WeblateOrg/weblate/issues/7520. The problem here is that in integer scope, rules for several languages are the same (sr/bs/ru/uk), but they differ in floating-point conditions. That's why in CLDR, they are once named one/few/other and once/few/many (keeping other for the floating-point bits). As Weblate sees only integer part here, it does not differentiate these and uses the same labelling for all of them.

The translate-toolkit has a hard-coded list of plurals per language from CLDR, so loading/saving should work fine, this is just display logic in Weblate which is wrong.

github-actions[bot] commented 10 months ago

Thank you for your report; the issue you have reported has just been fixed.

nijel commented 10 months ago

Oops, closed wrong bug.

github-actions[bot] commented 10 months ago

Thank you for your report; the issue you have reported has just been fixed.