I know many developers just do it like this: They start developing their app in English, and put NSLoclaizedString(@"Tap this to do that!", @"Telling what to do...")
instead of simply @"Tap this to do that!"
.
Then they run genstrings
which creates a Localizable.strings file somehow by extracting all these strings. The messy part: The long text used in code becomes the key. It works. Until one day where you quickly go into your code and change the english string and forget about Localization and that it serves as the key for all those Localizable.strings files.
So I tend to use "real" keys which don't get mixed up with strings. For a quick test I created a project localized to English and French. Then I set the Simulator language to German. Because, you know, it would suck terribly if the user would ever see the key like TTTDT
.
So with just English and German in place, I launched the demo app. And what I got was the English text from the English Localizable.strings file.
Conclusion: It seems that NSLocalizedString falls back to the English file if the OS language is not covered by the app.
Quesion: Assuming there IS always an Localizable.strings (English)
file, and the keys ARE in the file along with properly formatted values. Are there circumstances under which NSLocalizedString would fail and then display the key directly?