难以本地化xib文件 [英] Difficulty Localizing xib Files

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

问题描述

我已经本地化了两组xib,并将它们放在我的项目导航器中,如下图所示:

I have localized two sets of xibs and put them in my project navigator as shown in the picture below:

我的Localized.strings文件运行正常,但是有时选择的xib文件不正确.当我将设备语言设置为法语时,我会看到英语xib视图.当我将设备语言设置为英语时,我看到的是法语xib视图.

My Localized.strings files are working fine, but the xib files are sometimes selected incorrectly. When I set the device language to French, I see the English xib view. When I set the device language to English, I see the French xib view.

我从项目中删除了xib文件,仅删除了引用,然后将它们拖回到相同位置的项目中,如图所示.目前,无论设备设置为哪种语言,我都只会看到英语版本.

I removed the xib files from the project, deleting the references only, and then dragged them back into project in the same places, as the picture shows. Right at the moment, I'm only seeing the English version, regardless of which language I have the device set to.

有人可以看到我做错了吗?

Is there something anyone can see that I'm doing wrong?

(我已经读过这样的建议,像这样而不是为每种语言使用单独的框架.我可能会在某个时候切换到该框架,但是现在,我只想了解我的设置有什么问题.)

(I have read advice, like this one, on not using separate frames for each language. I may switch to that at some point, but right now, I just want to understand what is wrong with my set up.)

更新

这是en.lproj文件夹的文件组织. fr.lproj文件夹的设置方法相同.这些位于名为Resources的文件夹中.

Here is the file organization for the en.lproj folder. The fr.lproj folder is set up the same way. These are inside a folder called Resources.

更新-最终结果

我在右侧面板中尝试了我的xib文件的本地化设置.

I experimented with the localization settings for my xib files in the panel at the right.

,当我选择两种或多种语言进行本地化时,终于注意到了那些显示按钮.单击公开按钮会显示每种语言的xib文件.然后,我重做了外语xib的本地化. (我可能可以从现有的xib中复制并粘贴.)

and finally noticed those disclosure buttons when I had two or more languages selected for localization. Clicking on the disclosure button revealed a xib file for each language. I then had redo the localization for the foreign language xib. (I probably could have copied and pasted from the existing xibs.)

因此,文件现在的组织方式如下:

So the files are now organized like this:

推荐答案

项目导航器显示en.proj和fr.proj,但是文件是否真正本地化在文件系统的文件夹中?在XCode 4.2中,本地化文件将在括号中的文件名之后显示本地化.我在您的示例中看不到.这是我本地化的资源的样子.

The project navigator shows the en.proj and fr.proj, but are the files really localized in folders on the file system? In XCode 4.2 the localized files will show there localization after the file name in parentheses. I do not see that in your example. Here is what my localized resources look like.

要使XIB本地化,您需要将它们放入具有适当名称的文件系统上的文件夹中.从文件检查器中执行此操作最简单.

To make the XIB localized you need to put them into folders on the file system with the appropriate names. It is easiest to do this from the file inspector.

不知道这有帮助吗?

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

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