做语言国际化时创建的"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]*
网友评论