XCode - iOS 未考虑本地化

XCode - iOS localization not taken into account

我在这里查看了各种答案,但无法弄清楚发生了什么。

我的 iPhone 是法语的。我只有一个目标。我继续项目设置并说 "Add Localization" 并添加法语。

我确保

最终结果:故事板 已本地化 但可编程字符串 未本地化NSLocalizedString("xxx", nil) 显示 xxx 而不是 yyy)

有什么想法吗?这是我的配置的一些屏幕截图

谢谢

找到您遇到此问题的原因here

Note: Localizable.strings is the default filename iOS uses for localized text. Resist the urge to name the file something else, otherwise you will have to type the name of your .strings file every time you reference a localized string.

如果要使用不同的.strings文件进行本地化,需要使用方法:

- (NSString *)localizedStringForKey:(NSString *)key
                              value:(NSString *)value
                              table:(NSString *)tableName

并指定 Localized.strings 作为第三个 (tableName) 参数。