开发者

iPhone SDK: Localization of external class files?

开发者 https://www.devze.com 2023-02-05 16:35 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号