I'm in the middle of localizing my iPhone app, and I've gotten English, French, German and Japanese localizations working without any problems. Now I'm trying to get a simplified chinese localization working, and no matter what I try, the chinese .lproj bundle just won't be used when I have the phone set to simplified chinese.
我正在本地化我的iPhone应用程序,我已经使英语,法语,德语和日语本地化工作没有任何问题。现在我正在尝试简化中文本地化工作,无论我尝试什么,当我将手机设置为简体中文时,中文.lproj软件包将不会被使用。
One problem is that I'm not sure what the localization should be called. I've tried "Chinese", zh-Hans, zh-CN, zh_Hans, zh_CN and none of them work. I've even gone as far as digging around inside Remember The Milk's app bundle to see what they used. They're using zh_CN but that doesn't work for me.
一个问题是我不确定应该调用什么本地化。我试过“中文”,zh-Hans,zh-CN,zh_Hans,zh_CN,但都没有。我甚至在里面挖掘了Remember The Milk的应用程序包,看看他们使用了什么。他们使用zh_CN,但这对我不起作用。
Am I missing something obvious here? Do I need to update some plist somewhere? As far as I can see from reading the I18N documentation and looking at the relevant WWDC session video, all I should need to do is make sure I have the right .lproj bundle in my app bundle and I should be good to go... right?
我错过了一些明显的东西吗?我需要在某处更新一些plist吗?从我阅读I18N文档和查看相关的WWDC会话视频我可以看到,我应该做的就是确保我的应用程序包中有正确的.lproj包,我应该好好去......对?
If you think it would help, I can provide a test xcode project that demonstrates the problem...
如果您认为它会有所帮助,我可以提供一个测试xcode项目来演示问题......
Thanks
谢谢
4 个解决方案
#1
33
It's zh_CN for Simp. Chinese (简体中文), zh_TW for Trad. Chinese (繁體中文).
对于Simp来说,这是zh_CN。中文(简体中文),zh_TW for Trad。中文(繁体中文)。
If you are testing zh_CN.lproj under Trad. Chinese Language setting, it won't work. Just make sure you are testing your app with correct system language setting. Also, the Localizable.strings should be encoded with UTF-16 encoding.
如果您正在Trad下测试zh_CN.lproj。中文设置,它将无法正常工作。只需确保使用正确的系统语言设置测试您的应用。此外,Localizable.strings应使用UTF-16编码进行编码。
Update:
In latest Localization Programming Guide, these had been changed to zh-Hans and zh-Hant.
更新:在最新的本地化编程指南中,这些已更改为zh-Hans和zh-Hant。
Particularly in Chinese dialects, a region code is not always the best way to specify the proper dialect or script. For example, traditional Chinese (Han) is the default language spoken in * and is identified by the code zh_TW in Mac OS X v10.3.9 and earlier. However, traditional Chinese is also commonly spoken in * and Macao, which means the zh_TW designator is not entirely accurate in those locations. The new standard defines new tags for the traditional Chinese (Hant) and simplified Chinese (Hans) scripts. Thus, traditional Chinese spoken in any country uses the code zh-Hant. Traditional Chinese, as it is spoken in *, now uses the locale code zh-Hant_TW.
特别是在中国方言中,区域代码并不总是指定正确方言或脚本的最佳方式。例如,繁体中文(汉语)是台语中使用的默认语言,由Mac OS X v10.3.9及更早版本中的代码zh_TW标识。然而,在香港和澳门也普遍使用繁体中文,这意味着zh_TW指示符在这些地方并不完全准确。新标准为繁体中文(Hant)和简体中文(Hans)脚本定义了新标签。因此,在任何国家使用的繁体中文都使用代码zh-Hant。在*使用的繁体中文现在使用区域代码zh-Hant_TW。
#2
1
Since iPhone likes to cache resources, you should clean up your app project and re-build it. Then everything will work fine with your localization.
由于iPhone喜欢缓存资源,因此您应该清理应用程序项目并重新构建它。然后一切都可以正常使用本地化。
#3
0
when u add localization for any language other than Chinese u named as Arabic,German,e.t.c but for the chinese u have to restrict when naming because there are 2 chinese (simple and tradition) so in iphone localization u must named zh_CN(for simplified chinese) if u placed other name it could not translate so b carefull name must be
当你为中文以外的任何语言添加本地化时你的名字为阿拉伯语,德语等,但是对于中文你必须在命名时限制因为有2个中文(简单和传统)所以在iphone本地化你必须命名为zh_CN(简体中文) )如果你放了其他名字就无法翻译,所以必须小心谨慎
zh_CN (for simplified chinese).
zh_CN(简体中文)。
it resolves ur problem
:)
它解决了你的问题:)
#4
0
As digdog said above: "Also, the Localizable.strings should be encoded with UTF-16 encoding."
正如digdog上面所说:“另外,Localizable.strings应该用UTF-16编码进行编码。”
I found UTF-8 for Localizable.strings is alright too, I successfully made several language include zh_CN
我发现Localizable.strings的UTF-8也没问题,我成功地将几种语言包含在zh_CN中
I was guided by following post: http://www.cocoabuilder.com/archive/cocoa/277415-localization-strings-in-utf16-vs-utf8.html
以下帖子引导我:http://www.cocoabuilder.com/archive/cocoa/277415-localization-strings-in-utf16-vs-utf8.html
#1
33
It's zh_CN for Simp. Chinese (简体中文), zh_TW for Trad. Chinese (繁體中文).
对于Simp来说,这是zh_CN。中文(简体中文),zh_TW for Trad。中文(繁体中文)。
If you are testing zh_CN.lproj under Trad. Chinese Language setting, it won't work. Just make sure you are testing your app with correct system language setting. Also, the Localizable.strings should be encoded with UTF-16 encoding.
如果您正在Trad下测试zh_CN.lproj。中文设置,它将无法正常工作。只需确保使用正确的系统语言设置测试您的应用。此外,Localizable.strings应使用UTF-16编码进行编码。
Update:
In latest Localization Programming Guide, these had been changed to zh-Hans and zh-Hant.
更新:在最新的本地化编程指南中,这些已更改为zh-Hans和zh-Hant。
Particularly in Chinese dialects, a region code is not always the best way to specify the proper dialect or script. For example, traditional Chinese (Han) is the default language spoken in * and is identified by the code zh_TW in Mac OS X v10.3.9 and earlier. However, traditional Chinese is also commonly spoken in * and Macao, which means the zh_TW designator is not entirely accurate in those locations. The new standard defines new tags for the traditional Chinese (Hant) and simplified Chinese (Hans) scripts. Thus, traditional Chinese spoken in any country uses the code zh-Hant. Traditional Chinese, as it is spoken in *, now uses the locale code zh-Hant_TW.
特别是在中国方言中,区域代码并不总是指定正确方言或脚本的最佳方式。例如,繁体中文(汉语)是台语中使用的默认语言,由Mac OS X v10.3.9及更早版本中的代码zh_TW标识。然而,在香港和澳门也普遍使用繁体中文,这意味着zh_TW指示符在这些地方并不完全准确。新标准为繁体中文(Hant)和简体中文(Hans)脚本定义了新标签。因此,在任何国家使用的繁体中文都使用代码zh-Hant。在*使用的繁体中文现在使用区域代码zh-Hant_TW。
#2
1
Since iPhone likes to cache resources, you should clean up your app project and re-build it. Then everything will work fine with your localization.
由于iPhone喜欢缓存资源,因此您应该清理应用程序项目并重新构建它。然后一切都可以正常使用本地化。
#3
0
when u add localization for any language other than Chinese u named as Arabic,German,e.t.c but for the chinese u have to restrict when naming because there are 2 chinese (simple and tradition) so in iphone localization u must named zh_CN(for simplified chinese) if u placed other name it could not translate so b carefull name must be
当你为中文以外的任何语言添加本地化时你的名字为阿拉伯语,德语等,但是对于中文你必须在命名时限制因为有2个中文(简单和传统)所以在iphone本地化你必须命名为zh_CN(简体中文) )如果你放了其他名字就无法翻译,所以必须小心谨慎
zh_CN (for simplified chinese).
zh_CN(简体中文)。
it resolves ur problem
:)
它解决了你的问题:)
#4
0
As digdog said above: "Also, the Localizable.strings should be encoded with UTF-16 encoding."
正如digdog上面所说:“另外,Localizable.strings应该用UTF-16编码进行编码。”
I found UTF-8 for Localizable.strings is alright too, I successfully made several language include zh_CN
我发现Localizable.strings的UTF-8也没问题,我成功地将几种语言包含在zh_CN中
I was guided by following post: http://www.cocoabuilder.com/archive/cocoa/277415-localization-strings-in-utf16-vs-utf8.html
以下帖子引导我:http://www.cocoabuilder.com/archive/cocoa/277415-localization-strings-in-utf16-vs-utf8.html