iPhone中的本地化问题 [英] Localization problems in iPhone

查看:80
本文介绍了iPhone中的本地化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图用两种语言(英语和德语)对我的iPhone应用程序进行本地化

I have been trying to localize my iPhone app in two languages - english and german

我创建了两个文件夹en.lproj和de.lproj,每个文件夹包含用于相应语言的Localizable.strings文件.我已经将这些文件包含在资源文件夹中,并将这些文件的编码更改为UTF-16.

I have created two folders en.lproj and de.lproj each containing Localizable.strings file for respective language. I have included these files in my resources folder, changed the encoding of these files to UTF-16.

我尝试清理项目并重新构建,删除路径为库/应用程序支持/iPhone模拟器/用户"的文件夹

I have tried cleaning the project and building it again, deleting folder at path: Library/Application Support/iPhone Simulator/User

但是问题仍然存在.有想法的人请帮忙.

But the problem is still there. Anybody having an idea please help.

推荐答案

我们添加了2种语言(为了测试该过程,使用了1个欧洲语言和1个亚洲人双字节语言)

We have added 2 languages (to test the process, 1 European & 1 Asian double byte)

这是一个分为两个阶段的过程,您将需要对字符串和xib进行本地化.对于字符串,

It's a two stage process, you will need to localize both your strings and your xibs. For the strings,

  1. 创建Localizable.strings(仅在MacOSX资源下可用)
  2. 右键单击新文件,然后单击获取信息"
  3. 点击使文件可本地化"按钮(这将自动添加一种语言-对我来说是英语)
  4. 在网上论坛&文件",您现在应该可以展开资源文件并查看新语言
  5. 从命令行运行命令 genstrings -o English.lproj *.m.这将解析您的.m文件,并提取所有NSLocalizedStrings并将其放入文件中.
  1. Create the Localizable.strings (Only available under the MacOSX resources)
  2. Right click the new file and 'Get Info'
  3. Click the button 'Make File Localizable' (This will automatically add one language - English for me)
  4. In the 'Groups & Files' you should now be able to expand the resource file and see the new language
  5. From the command line run the command genstrings -o English.lproj *.m. This will parse your .m files and extract all the NSLocalizedStrings and put them in the file.

如果再次执行获取信息",则应该可以添加更多语言

If you do Get Info again, you should be able to add more languages

对于xib,右键单击它们并使文件可本地化".然后可以分别翻译这些内容

For the xibs, right click on them and 'Make File Localizable'. These can then be translated separately

这篇关于iPhone中的本地化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆