Is it possible to switch between different localizations when developing a Mac application?
I am developing an application in Mac OS X. To make the application more accessible I localized it using different XIB and strings fi开发者_如何学Pythonle. As the strings in different languages can be different in length and to make sure I have not forgotten a string I have the following question:
Is it possible to switch to a different language when developing this application? I know I can set the language for the whole system and log out and back in but that is a bit cumbersome for a quick check.
Is there maybe some Info.plist
key one can set?
There is no need to logout. The language setting in System Preferences applies to any subsequently launched applications, so all you have to do is change the language, quit your application and reopen it.
You can also permanently change the language that will be used by a given application by adding the AppleLanguages
key to the application's defaults. For an example of its value, you can look for that key in the global domain, which is what System Preferences set (use defaults read NSGlobalDomain AppleLanguages
). This way, you can even make a script that lets you test all languages in a loop.
精彩评论