Here is my code:
NSString *string = [bundle localizedStringForKey:@"kTCStringMissing" value:@"" table:nil];
I know that the bundle variable is pointing to the correct bundle because the English value is coming out correctly -- see below.
My bundle structure looks like this:
ToyCalculatorUI.bundle
en.lproj [directory]
Localizable.strings [file]
de.lproj [directory]
Localizable.strings [file]
My Localizable.strings look like this:
in the en.lproj directory:
kTCStringMissing = "Missing Fields en";
in the de.lproj directory:
kTCStringMissing = "Missing Fields de";
But when I run my app in the simulator, after setting the language to Deutsch, and the region to Deutschland, the *string object above always has value "Missing Fields en".
What am开发者_如何学运维 I missing?
imho you have to quote the keys, too. (see Apple's Resource Programming Guide for details)
i.e. "kTCStringMissing" = "Missing Fields en";
精彩评论