views:

71

answers:

1

I currently have two supported languages: English and Spanish. Thus I have two main.strings files for each language. One in en.lproj and one in es.lproj.

What I want now is that the English main.strings is the default file if a user with a locale other than en or es arrives at the application, e.g. de or fr.

I know I can set it manually for each string in the code with the defaultString parameter:

NSLocalizedStringWithDefaultValue(key, @"main",[NSBundle mainBundle], defaultString, comment);

But I would prefer to not enter it there again (and have to change it at two places), but rather have the en main.strings file as a default for any other "unsupported" locale.

+1  A: 

What I want now is that the English main.strings is the default file if a user with a locale other than en or es arrives at the application, e.g. de or fr.

Did you try that? I’m almost certain the application will fall back to the English locale without you doing anything at all. Even the system dialogs will come up in English unless your application explicitly supports the current locale.

zoul
Argh. You're totally right. Stupid of me for not testing thoroughly. Instead of using a completely different language I used "es" for testing, for which I already had an empty string file created.
znq