Skip to content

Add suppport for decimal plurals (Android cs/fr/lt/sk are missing "many" in plurals) #7520

Description

@eighthave

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]
    <plurals name="details_last_update_months">
    ^
/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]
    <plurals name="details_last_update_years">
    ^
/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]
    <plurals name="button_view_all_apps_in_category">
    ^
/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]
    <plurals name="tts_view_all_in_category">
    ^
   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 <plural> 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

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: File format supportIssues related to file formats implemented in Weblate.Waiting for: DemandLow priority for development. Pull requests welcome. Can be prioritized by sponsorship.enhancementAdding or requesting a new feature.

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions