ios – Tips on how to implement plurals in a String Catalog for labels that do not present numbers?

0
111


I’m localizing my app and I have to deal with textual content views that show pluralized nouns with out displaying a selected quantity. Eg:

VStack(alignment: .heart, spacing: 0) {
      Textual content("(stepperValue)")
      Textual content("(merchandise.actionCount, specifier: specifier) (literal: actionNameVariable)")
 }

I’m utilizing an answer from this SO publish for combining literals with formatted values to kind a localization key:

I tried to take away the quantity instantly within the translation. Nevertheless, when I’ve two languages, with English as the bottom language, eradicating the depend from the English translation leads to:

string catalogue screenshot

which I assume make sense, trigger iOS does not know methods to deal with pluralization with out an precise quantity.

If I depart it with a quantity in English, in all different languages I can take away the quantity in translation. Nevertheless, this isn’t a whole resolution as a result of the bottom language nonetheless shows the quantity.

What can be a strategy to deal with this appropriately?