Localization: which files go where?
Apologies if this is one of those things that's obvious to Cocoa programmers, but exactly where do the localization strings files go in your xcode project to build properly? Right now I have a single folder inside my main application project folder called "languages": the layout of it is something like this:
- languages
-- de.lproj
--- Localizable.strings
-- en.lproj
--- Localizable.strings
-- es.lproj
--- Localizable.strings
-- fr.lproj
--- Localizable.strings
I added the top-level "languages" folder to my Resources folder using "Add->Existing files..." , unchecked "Copy items into destination group's folder", selected Text Encoding: Unicode (UTF-16) and clicked Add.
I find that when I switch the simulator or device language, I get somewhat random results. Some strings show up in the language I expect; often, however, they show up in French regardless of the locale settings. I've also found the behavior is pretty inconsistent between the device and the simulator.
BTW I'm consistently using NSLocalizedStringWithDefaultValue throughout my code-- the default values are in English.
Anyone else having luck with localization?
|