Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone: localization / internationalization default strings file

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.

like image 433
znq Avatar asked Jun 22 '10 14:06

znq


1 Answers

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.

like image 59
zoul Avatar answered Sep 22 '22 09:09

zoul