WeblateOrg / WeblateOrg/weblate
Add suppport for decimal plurals (Android cs/fr/lt/sk are missing "many" in plurals)
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 1.4k
- Avg merge
- 9h 53m
- Merged PRs (30d)
- 395
Description
### 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
```
^
/builds/grote/fdroidclient/app/src/main/res/values-cs/strings.xml:396: Error: For locale "cs" (Czech) the following quantities should also be defined: many [MissingQuantity]
^
/builds/grote/fdroidclient/app/src/main/res/values-cs/strings.xml:401: Error: For locale "cs" (Czech) the following quantities should also be defined: many [MissingQuantity]
^
/builds/grote/fdroidclient/app/src/main/res/values-lt/strings.xml:406: Error: For locale "lt" (Lithuanian) the following quantities should also be defined: many [MissingQuantity]
^
/builds/grote/fdroidclient/app/src/main/res/values-lt/strings.xml:501: Error: For locale "lt" (Lithuanian) the following quantities should also be defined: many [MissingQuantity]
^
Explanation for issues of type "MissingQuantity":
Different languages have different rules for grammatical agreement with
quantity. In English, for example, the quantity 1 is a special case. We
write "1 book", but for any other quantity we'd write "n books". This
distinction between singular and plural is very common, but other languages
make finer distinctions.
This lint check looks at each translation of a and makes sure that
all the quantity strings considered by the given language are provided by
this translation.
For example, an English translation must provide a string for
quantity="one". Similarly, a Czech translation must provide a string for
quantity="few".
https://developer.android.com/guide/topics/resources/string-resource.html#Plurals
```
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
- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] I've searched for similar issues in this repository.
### Steps to reproduce the behavior
These are some of the strings:
* https://hosted.weblate.org/translate/f-droid/f-droid/lt/?offset=1&q=button_view_all_apps_in_category&sort_by=-priority%2Cposition&checksum=
* https://hosted.weblate.org/translate/f-droid/f-droid/cs/?offset=1&q=details_last_update_months&sort_by=-priority%2Cposition&checksum=
### 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_
Contributor guide
Assessment
This issue has not been assessed yet.