Localizing Property List Values

You may want to provide localized versions of strings that are provided by the plist file for your app.

This could be

  • The App Title
  • Permission requests etc

Create a language folder

The first step is to create a language folder for the language, or languages, you want to provide localization for. The folder name has the form <language code>.lproj. The language code is the the two-letter ISO 639-1 standard (preferred) or the three-letter ISO 639-2 standard code for the language. You can find a list of these codes here.

As example we will create a German folder so we name it de.lproj.

Create an InfoPlist.strings file

The next step is to create an InfoPlist.string file in the de.lproj folder.

Then add any keys for the plist file that you want to localize in the form

<plist key>=<localized value>.

For example to localize the Location Services permissions dialogs you would add

"NSLocationWhenInUseUsageDescription"="Diese Anwendung erfordert Zugriff auf Location Services, wenn sie verwendet wird, um lokale Restaurants zu finden"

Include the de.lproj folder

To include the localized strings add the de.lproj folder to the Copy Files pane of the Standalone Application Settings.

Build and test the standalone

If you are testing on a device with the language set to German the localize permission request will show.


Add your comment

E-Mail me when someone replies to this comment