Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Localization - NSBundle



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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.