Like unit testing, localization is one of those things most developers know they should do, but end up skipping for one reason or another.
In Xcode 4, using localized strings is a piece of cake. To start, create a new strings file to store your default localization. Select “New File…” (Command-N or Control-click in the Project Navigator) and choose “Strings File” under iOS > Resource.
Once you’ve created the strings file, you need to localize it. Open up the File Inspector (Command-Option-1 or View > Utilities > File Inspector) and click on the plus sign under Localization. Select the language to localize and you’re good to go.
Here’s an example of a strings file:
Strings can fit on a single line or wrap across multiple lines.
Once you have a few localized strings, it’s a piece of the aforementioned cake to reference them in your Xcode project. For example, here’s how to set the title in the root view controller using a localized string:
Things get a bit more complicated when you have multiple bundles and tables, but the above should suffice for most projects.