In my iPhone app, I need to display object counts which I then localize, since English makes the distinction of singular and plural, I do the following
// pseudocode
if (objectList.count == 1) { NSLog(@"%@", NSLocalizedString(@"1 object", @"display one objects"); } else { NSLog(@"%@", NSLocalizedString(@"%d objects", @"display multiple objects"); }
This works for English but in many other languages the plural form of a noun is not simply constructed by adding an ‘s’.
As this page explains, there are two things which can differ between languages:
- The form how plural forms are built differs. This is a problem with languages which have many irregularities. German, for instance, is a drastic case. Though English and German are part of the same language family (Germanic), the almost regular forming of plural noun forms (appending an ‘s’) is hardly found in German.
- The number of plural forms differ. This is somewhat surprising for those who only have experiences with Romanic and Germanic languages since here the number is the same (there are two).
How should I deal with this in my code?