O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

For the More Curious: Localization and Plurality

Sometimes, you will want to use different strings depending on whether one of the terms in the string is singular or plural.

For example, when you remove a single employee in the English localization of RaiseMan, the app will present an alert with broken English (Figure 26.7).

Figure 26.7  Incorrect message in RaiseMan’s remove alert

Incorrect message in RaiseMan’s remove alert

To address this, you could programmatically check whether the number of employees being removed is equal to one or greater than one. This would work just fine for English and French – but, as it turns out, this is not a robust solution.

In English ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required