添加可本地化的文件在Xcode 4上投影 [英] Adding localizable files to project on Xcode 4

查看:112
本文介绍了添加可本地化的文件在Xcode 4上投影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要本地化的应用程序。

我已经按照以下步骤操作:


  1. 我用finder在项目的根目录下创建了es.lproj,it.lproj,en.lproj文件夹。


  2. 我已经在每个文件夹中创建了Localizable.strings文件,其中键值对应于目标语言。

  3. 添加文件到Xcode的选项。


当我在iphone模拟器中测试应用程序时,但是,当我在设备上运行应用程序,只显示英文字符串。

>

我已经按照这些步骤进行了测试。
$ b


  1. 支持文件夹,新文件上的右键。


  2. 创建Localizable.strings文件

  3. >在文件检查器中,部分本地化。我已经添加了其余的语言。创建文件就像一个文件夹,其中包含树中的所有可Localizable文件。
  4. 在项目的根文件夹中,xcode为每种语言创建一个文件夹。 / p>


  5. 在编辑完每个文件之后,我已经在模拟器中执行了,并且都正常工作。我已经测试了3种不同的设备,唯一的语言是英语。

    $ b $ p在Project - > Info - >本地化我已经添加了每种语言。
    在构建阶段,我发现只有引用en.lproj文件夹中的Localizable.string文件。我试图添加其余的文件,但只接受一个本地化的文件。我已经在设备上用额外添加了语言进行了测试,但没有成功。

    有人可以帮我吗?

    在此先感谢。

    解决方案

    您是否尝试从设备中删除应用程序,然后重新安装?编辑:我检查了我的一个项目,我看到的名字是:English.lproj,French.lproj等。


    $ b

    不知道这是否会有所作为,但你可以尝试。另外,您可以使用Finder进入iPhone的应用程序二进制文件,并选择显示包内容来检查其内容,并确保本地化文件在那里这可能有助于确定问题...

    I'm developing an App that needs Localization.

    I've followed these steps:

    1. I've created the es.lproj, it.lproj, en.lproj folders in the root of the project with finder.

    2. I've created the Localizable.strings file in each folder with the key pair values corresponding to the target language.

    3. I've imported with Add Files To option from Xcode.

    When I test the App in the iphone simulator all works fine. I configure the iphone to any localizaed language and the app is translated properly.

    But when I run the App in the device, only shows the strings in english.

    I've made a test following these steps.

    1. From Xcode 4 right button over Supporting Files Folder, New File.

    2. Create Localizable.strings file

    3. In file inspector, section Localization. I've added the rest of languages. Creating the file like a folder with all Localizable files in the tree.

    4. In the root folder of the project, the xcode created a folder for each language.

    5. After editing every file, I've executed in simulator and all works fine. I've tested in 3 different devices and the only language is English.

    In the Project -> Info -> localization I've added every language. In the Build Phases I've observed that only is referenced the Localizable.string file in the en.lproj folder. I've tried to add the rest of files, but only accepts one more Localizable file. I've tested in device with the "extra" added language but doesn't works.

    Can someone help me please?

    Thanks in advance.

    解决方案

    Have you tried to delete the app from the device and then reinstalling?

    EDIT: I have checked in a project of mine and the names I see are: English.lproj, French.lproj, etc.

    Don't know if this could make a difference, but you could try it. Also, you can go to the app binary for the iPhone with the Finder and select Show package content to inspect its content and make sure the localization files are there This could help to pin down the problem...

    这篇关于添加可本地化的文件在Xcode 4上投影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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