iPhone SDK: Localization of external class files?
I am adding some external classes to my already-localized project that include their own localization strings. For some reason the localization isn't working in these classes. It should be noted that I am not copying the external class files to my project, just adding a reference to them. I thought the problem could be that the external string file couldn't have the same name as the projects string file -- Localizable.strings -- so I changed it to something unique for the class. This didn't help. I also tried dragging the classes string files directly to the "C开发者_StackOverflowopy Bundle Resources" of my project to make sure that the strings in the bundle. Still no luck.
Interestingly, if I add these localized classes to a different project that isn't yet localized -- e.g. there isn't any Localizable.strings file in the project -- the class localizations work fine.
Suggestions?
You should use NSLocalizedStringFromTable instead of NSLocalizedString to extract strings from tables other than the default Localizable.strings.
精彩评论