开发者

Fallback language doesn't seem to work (iOS/iPhone)

This app has been under development for more than a year and has had multiple releases already. This development cycle I noticed that the "fallback" language doesn't seem to work anymore.

The app had 3 targets: CountryA, CountryB and CountryC. Each target has the following localization directories:

  • CountryA: en.lproj, langA.lproj, langB.lproj
  • CountryB: en.lproj
  • CountryC: en.lproj, langC.lproj

In each targets info.plist a key "CFBundleDevelopmentRegion" with value "en" is specified.

The project.pbxproj file has both the following key/values specified in the PBXProject section:

  • developmentRegion = en;
  • kn开发者_如何学CownRegions = ( English, Japanese, French, German, en, fr, dk, da, nl, new, pt, de, );

When I start the app on an iPhone or in the iPhone simulator with the system language set different from one of the specified localization directories the UI shows the NSLozalizedString identifiers instead of the localized strings. Even when I specify "English" as System Language in iOS!

So... for some reason the en.lproj file is not picked up, because if I use langA or langB as System Language for target CountryA everything is as expected.

Any help is appreciated!

Kind regards, Niels R.

NOTE: The problem is caused by a plugin of an external company that we had to integrate and which has a Localizable.strings file too. This will cause that "our" Localizable.strings is overwritten.

Sorry to bother with this! Seems that I just had to look a little bit further before asking the question.


"the UI shows the NSLozalizedString identifiers instead of the localized strings" -- Are you adding the Localizable.strings file correctly for the individual targets?

Another problem could be the "region" setting for languages. You should try to change the region too in the Simulator. I have seen unexpected things happening to NSLocale when setting the region to something totally different than the language.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜