views:

89

answers:

1

I use everywhere NSLocalizedString(@"Text in deutsch",@"das Textfeld Text in deutsch") I have two Localizable.strings files. One for german and one for english.

What I realized now is. If you have a german iPhone, you get the german text, if you have your iPhone set to english you get the english text. But if you have lets say french, then you would get the german text, too because I use german as the keys, right ? Is there a way to set english as fallback language instead of the german one used everywhere in my code ? (I have so many occurences of NSLocalizedString that it would be a pain to change the keys now everywhere (in code, in Localized.string.en and in Localized.string.de))

+1  A: 

A localization (something.lproj) is always picked. The keys themselves aren't used if the l10n provides a translation; this means you can use keys like "DISCOMBOBULATE_OR_OK" which translates to "Discombobulate" in languages where it fits and "OK" in languages where the translation for "Discombobulate" is too long for the space available.

Possibilities:

  • The language in Info.plist's CFBundleDevelopmentRegion is used to pick the default language.
  • The phone's fallback language is influenced by where you buy it (For example, on my languages screen, "English" is always displayed either first or second.)

It's worth asking someone with a UK/US/AU phone to test.

tc.
It works now, thank you
Allisone