首先我使用了genstrings,它在en.lproj文件夹中创建了一个Localizable.strings文件(也存在于文件系统中).
然后我有一个我想要本地化的JSON文件,所以我打开了该文件的信息窗格并选择“Make File Localizable”. Xcode然后在文件系统上创建了一个English.lproj文件夹,并且还创建了一个这样的组.然后它将我的文件移到那里.
所以现在我最终得到了en.lproj和English.lproj基本相同的东西:英文的东西.
我对这种情况不满意.可以/我应该做些什么吗?我该如何解决这个问题?
此外,有人可以指出使用“English.lproj”与“en.lproj”之间的区别是什么?我打赌有区别.
解决方法
您可以手动编辑项目文件以避免问题as this post suggest,但我从未真正发现这样做是值得的.
一些背景 – 在Max OS X 10.4之前使用了遗留(但更多用户可读)的名称,如“英语”,“西班牙语”等,但Apple internationalization documentation声明这些值现已弃用:
In addition to the ISO language designators,the bundle routines
also recognize several legacy language designators. These designators
let you specify a language by a user-readable name,instead of by a
two or three character code. Designators included names such as
English,French,German,Japanese,Chinese,Spanish,Italian,Swedish,
and Portuguese among others. Although these names are still recognized and processed by the NSBundle class and Core Foundation bundle functions,their use is deprecated and support for them in future versions of Mac OS X or iPhone OS is not guaranteed. Use the codes described in “Language Designations” and “Regional Designations” instead.