问题
What am I doing wrong???
NSString * ew= NSLocalizedString (@"CITY",nil);
//Add items
[listOfItems addObject:ew ];
and I have my localized.string in which I have
"CITY" = "Prague";
.....doesn't work neither in iPhone simulator or device. if I dislay it, it display CITY instead of Prague.
Thanks
EDIT:
Language is set properly and in Localizable.strings I have two strings to localize. and they are so:
"TITLE" = "Availiable cities"; "CITY" = "Pragues";
and in the
other localizations I have
"TITLE" = "Translation"; "CITY" = "Translation";
回答1:
The string file should be named Localizable.strings. Also, is that the only string you have in the file? If you have a formatting error in the Localizable.strings file, you won't get the value for your key.
回答2:
As localized string is device's language dependent, make sure your language has been changed on device/simulator before testing this. If your language is set to English, you will never see "Prague" as the string will always be mapped to the English version of the localized string.
good luck.
来源:https://stackoverflow.com/questions/9322701/localization-issue-xcode