RamaKrishna Chunduri
RamaKrishna Chunduri

Reputation: 1130

Issue with NSLocalizedString, bundle and IOS5

Problem is

First we implemented localizations with .lproj folders like fr.lproj, en.lproj ,es.lproj etc.

Later as per the request from one of the reviewer (internal reviewer not someone from apple) we have switched to iso-639-2 based language codes.

So, the folders are changed to fra.lproj,eng.lproj,spa.lproj etc and the project references are added to use new files. removed for old files.

After renaming the folders the changes done and new strings added in localizable.strings file are not affected in the app.

After a bit research we found that both the folders for each language are included in the application and ios5 is using the fr.lproj folder contents and not fra.lproj folder contents. We ran the same app in the IOS 4 and the app works like a charm with updated localizations.

Please help me with a method to prioritize usage of iso-639-2 language codes in ios 5.

Thanks

Upvotes: 0

Views: 464

Answers (1)

Dirk
Dirk

Reputation: 31061

From Apple's documentation:

Within the Resources directory of a Mac OS X bundle (or the top-level directory of an iOS application bundle), you can create one or more language-specific project subdirectories to store language- and region-specific resources. The name of each directory is based on the language and region of the desired localization followed by the .lproj extension. To specify the language and region, you use the following format:

 language_region.lproj

The language portion of the directory name is a two-letter code that conforms to the ISO 639 conventions. The region portion is also a two-letter code but it conforms to the ISO 3166 conventions for designating specific regions

(emphasis mine). I'm not sure, why it might have worked in other projects of yours, but according to the documentation, the name of the localization directories needs to follow ISO 639-1 (two-letter codes).

Upvotes: 1

Related Questions