Localization - NSBundle
Localization - NSBundle
- Subject: Localization - NSBundle
- From: Simon Wright <email@hidden>
- Date: Mon, 31 Dec 2001 16:32:10 -0500
I'm trying to localize my app and have partially succeeded. In my project,
under the Groups & Files section, I have...
MainMenu.nib showing two variants: English and French
InfoPlist.strings showing two variants: English and French
these two were created automatically when I selected Add Localized Variant
from the Localizations & Platforms popup menu in the Show Info window.
I also have...
Localizable.strings showing two variants: English and French
I created the first one (English) manually and then the French one using
the same method as above and then translated the strings.
When I choose French as my preferred language in the International System
Preference I get the french version of my nib but I am not getting the
french version of my strings in code.
In my code I have...
NSBundle myBundle = NSBundle.mainBundle();
and then reference my strings thusly...
myBundle.localizedString("StringKey")
I've also tried...
myBundle.localizedStringForKey("StringKey","","")
but they both return the English versions of my strings.
In Targets, Bundle Resources I do see all three files each showing with 2
variants.
Any ideas?
TIA.
Happy New year!
Simon