iOS Plurals Library

In English, the plural rules are quite simple. A noun is singular if the number is 1, otherwise it’s plural. For instance, we “upload 1 file” or “upload 18 files”. Simple, but it gets a lot more complicated in other languages. Russian has four plural forms and Arabic has six forms, while written Chinese doesn’t have the concept of plurals at all. The Unicode CLDR has a full list of plural rules for each language if you would like to learn more.

Why did we make time to do this?
Supporting linguistic plurals is complex but essential if you want a high-quality, multilingual app. Plus, developers who haven’t been involved in localization projects probably aren’t aware of these very important linguistic nuances. This is why we were surprised that Apple doesn’t provide support for plurals, given their otherwise thorough approach to localization. In fact, they recommend some techniques that are kind of lame like avoiding this type of natural language by writing display strings to avoid the issue altogether.

The Smartling team decided to tackle this complicated initiative after hearing numerous complaints from customers who were unwilling to sacrifice the natural language that is necessary to engage with their global audiences in a way that is relevant and authentic.

How it works
Our plural processing is based on the Unicode CLDR Project. The plural strings will be tagged with a mnemonic plural indicator (zero, one, two, few, many, other). The mnemonic indicator will be part of the key in your strings file, e.g.

/* Number of credits the user purchased */
“purchaseCredits##{one}” = “You have %@ credit.”;
“purchaseCredits##{other}” = “You have %@ credits.”;

In the above text, the key “purchaseCredits” has been appended with ##{one} and ##{other}, signaling that there are two English plural forms.

The Russian file for this same set of strings would look like the following based on their specific plural rules:

/* Number of credits the user purchased */
“purchaseCredits##{one}” = “У вас есть %@ кредит.”;
“purchaseCredits##{few}” = “У вас есть %@ кредита.”;
“purchaseCredits##{many}” = “У вас есть %@ кредитов.”;
“purchaseCredits##{other}” = “У вас есть %@ кредитa.”;

The lookup of the string is then executed with the use of an SLPluralizedString function that is part of the Smartling ios-i18n library, e.g.

SLPluralizedString(@”purchaseCredits”, numberOfCreditsPurchased, @”Number of credits the user purchased”);

Note: Similar to NSLocalizedString, there are other lookup options available as well. You can find the full list in the ReadMe section of the iOS 18n Library.

When calling SLPluralizedString at runtime, the Smartling ios-i18n library will look up which plural string (zero, one, two, few, many, other) should be used based on the locale and the variable entered. In this example, that would be numberOfCreditsPurchased.

Check out our Step-By-Step iOS Plurals Implementation Guide for more details.

The i18n iOS Plurals Library
While our plurals library is completely open-source, you will find that using it along with the Smartling platform will greatly relieve your localization pains. Why? Here are three reasons:

  1. We are currently the only translation management system that supports the iOS plural format (After all, we designed it, so we better support it).
  2. We have a sophisticated API that automates the upload and download of your iOS string files — and many other formats too.
  3. You won’t need to understand the plural forms of your target languages to get started. The Smartling UI highlights each plural form that needs to be translated, ensuring the correct forms get back into your translated file.

Regardless of how you implement the iOS Plurals Library, the Smartling Team hopes it is another step towards solving your localization problems. We can’t take all of the credit, however! Thanks go to JJ Plurals for providing the basis of our initial research and implementation and our friends at for their input throughout the process.

If you have any feedback on the library, or would like to recommend improvements, please contact us at We would love to hear from you.