I know that many developers simply do it this way: they begin to develop their application in English and put it in NSLoclaizedString(@"Tap this to do that!", @"Telling what to do...")place of simply @"Tap this to do that!".
Then they run genstrings, which somehow creates the Localizable.strings file, extracting all these lines. Minor part: the long text used in the code becomes the key. It works. Until one day, when you quickly go into your code and change the English line and forget about localization and that it serves as the key for all Localizable.strings files.
Therefore, I tend to use "real" keys that do not mix with strings. For a quick test, I created a project localized in English and French. Then I installed the simulator language in German. Because, you know, it would suck terribly if the user saw such a key as TTTDT.
So, only with English and German, I launched a demo application. And what I got was the English text from the English Localizable.strings file.
Conclusion: It seems that NSLocalizedString is returning to the English file if the OS language does not apply to the application.
Quesion: Assuming there is always a file Localizable.strings (English), and ARE keys are in the file along with correctly formatted values. Are there circumstances under which NSLocalizedString will fail and then display the key directly?
source
share