美文网首页
iOS语言国际化注意问题

iOS语言国际化注意问题

作者: Joseph_Zheng | 来源:发表于2015-09-29 15:05 被阅读103次

做语言国际化时创建的"String File"文件名必须命名为" Localizable.strings ",否则NSLocalizedString获取不成功。

应用内不依赖系统语言的实现:

define AppLanguage @"appLanguage"

define CustomLocalizedString(key, comment) \

[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]] ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:nil]*

相关文章

网友评论

      本文标题:iOS语言国际化注意问题

      本文链接:https://www.haomeiwen.com/subject/rwgwcttx.html