I am using NSLocalizedString(); function for my localized strings. Even though i change my preferred language in simulator settings my string still get shown up in English.
Can we test the NSLocalizedString(); from simulator? if so how?
Can any one guide me through this please?
-- Regards,
U'suf
A localized string can have different values depending on the language in which the project is being build. There are two categories of localized strings: the strings included in the installation package's UI, common to every MSI file.
The key used to look up an entry in a strings file or strings dictionary file.
To answer how to test localized string on simulator?
I will assume that you have successfully added the Localizable.strings files for various languages you and you app want to target.
Step 1 - Goto target in the run destination.
Step 2 - Expand the menu to show options and then click on "Edit Scheme"
Step 3 - Click on "Run" and then select "Options". Choose the language you want to test for in the drop down available in the "Application Language"
Step 4 - CMD + R
That should be it!!
Please note that if you choose a language for which no Localization.string file was provided then it will show development language, which is more or less English.
Another but tedious way is to go to Simulator Settings > General > Language & Region > iPhone Language and choose the language. Since simulators can be buggy (like mine is) this process can be time consuming. Most of the time requiring rebooting of simulator (yet another time consuming task) for the changes to reflect.
Hope it helps!
Code and Prosper
Edit : Official Apple Link. If anyone is looking. Pointer -> "Testing Specific Languages and Regions"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With