Android translation of plurals changes attribute and fails CI

Android plurals have an xml structure like this

<plurals name="magnet_format">
        <item quantity="one">%d magnet</item>
        <item quantity="many">%d magnets</item>
    </plurals>

and the “quantity” tag is related to how plurals are handled by a language, so it can different between different strings.xml files.

Crowdin seems to be changing the attribute of quantity when they are different between files. For example

<item quantity="many">%d magnets</item>

becomes

<item quantity="other">%d magnets</item>

but the French language needs “many” and not “other”. Android added a check for this on its linter so now CI fails with the error

app/app/src/main/res/values-fr/strings.xml:207: Error: For locale "fr" (French) the following quantity should also be defined: many (e.g. "1000000 de jours") [MissingQuantity]
    <plurals name="seeders_format">
    ^
1 Like

You’re using new French rules, right? I saw few topics here in community, seems there was a language rules update recently, and “Many” was added to few languages, along with French.

I had a private direct conversation with Crowdin support, they told me that the task about native support of a new “many” will be released as 1 deployment-update for all languages that were affected by this “many” change. It’s a big task and should be done approximately in Q1 2023.

1 Like

Yes, Thanks for the reply. I searched for previous questions but couldn’t find anything. I still have my weblate instance so maybe I’ll use that again (if it actually support this feature) in the meanwhile

1 Like

Hello @LivingWithHippos

I can confirm that we will be updating languages, you can see my detailed reply here:

1 Like

Thanks for taking the time to answer me. Luckily my project is a small open source one so I don’t need this immediately.

My two cents:
add an option to the config yaml to avoid changing the quantity attribute, or an even more generic one so that we can avoid changing a specific attribute, for example

ignored_attributes: ["quantity"]

maybe per-language to avoid issues

1 Like

@LivingWithHippos thanks for the suggestion, we’ll think about it :wink:

2 Likes