Pluralized Phrases in Mobile App Projects
Localize supports plurals in source phrases and translations
Localize supports plural forms of phrases in files that are imported and exported in a Mobile App project. Once in the dashboard, you can edit the various plural forms of the source phrase and translations.
Localize supports 6 different plural forms for a phrase:
zero, one, two, few, many, other
Localize allows you to specify any combination of these variants in your plural phrases.
For the following documentation we imported this sample Android XML file into the Localize dashboard:
<resources>
<plurals name="numberOfAirplanes">
<item quantity='zero'>There were no airplanes in the sky today.</item>
<item quantity='one'>There was an airplane in the sky today.</item>
<item quantity='two'>There were a couple of airplanes in the sky today.</item>
<item quantity='few'>There were a few airplanes in the sky today.</item>
<item quantity='many'>There were %d airplanes in the sky today.</item>
<item quantity='other'>There were %d airplanes in the sky today.</item>
</plurals>
<plurals name="numberOfBugs">
<item quantity='zero'>There were no bugs on the plant.</item>
<item quantity='one'>There was one bug on the plant.</item>
<item quantity='many'>There were %d bugs on the plant.</item>
</plurals>
<plurals name="numberOfSongsAvailable">
<item quantity='one'>One song found.</item>
<item quantity='other'>%d songs found.</item>
</plurals>
<string name="hello">Hello!</string>
</resources>
Managing Source Language Plural Forms
The following phrases were imported into the Localize dashboard.
To modify the various plural forms in the source language (or to add a missing one), click the Edit plurals link in the drop-down menu for that phrase.
This will display the Plural forms dialog where you can make any necessary changes, or add more plural forms if they were missing. Click the arrow button when done.
Managing Translations for Pluralized Phrases
To manage the translations for a pluralized phrase, click on a translation or click the Edit button in the phrase's panel.
Edit a Translation
To edit a translation, click in the text entry field for that translation, make your changes then click Publish.
Add a Translation
To add a translation for a new plural form, click the Add Plural drop-down and select the new plural form.
Then enter the translation in the text entry field for that plural form.
Note: In some languages there may not be an equivalent plural form in the source language.
Delete a Translation
To delete a translation, click the Delete button below that translation.
Note: You cannot delete all translations of a pluralized phrase.
Updated 9 months ago