使用 xcode 4.0.2 本地化资源
我在尝试使用 xcode 4.0.2 本地化应用程序时遇到多个问题。 这个应用程序最初是用以前的版本编码的,但自从我安装了 4.0.2 以来,除了本地化之外,一切(或多或少)都正常工作。我有大约 10 个 png,它们使用 Interface Builder 通过 UIImageView 加载到 10 个不同的 xib 中。这些 png 已“正确”本地化,在 es.lproj 文件夹中是西班牙语的,在 en.lproj 文件夹中是英语的。 奇怪的是,即使在 xcode 中,当我打开 xib 文件时,它有时会显示英语版本,有时会显示西班牙语版本。 ?? xib 没有本地化,因为那里没有什么可以本地化的,只有带有 png 的 UIImageView 。
难道不能只本地化 png 的吗?
有谁知道这个问题是否响应已知的错误?
这个png的名称为text1.png、text2.png、text3.png ...这可能与序列化命名有关吗?
I am having multiple issues trying to localize an app with xcode 4.0.2.
This app was coded initially with previous version, but since I installed the 4.0.2 everything (more or less) has worked, except localization. I have about 10 png's that load in 10 different xibs via UIImageView using Interface Builder. These png's are "correctly" localized, inside the es.lproj folder the spanish ones and in the en.lproj folder the english ones.
The weird thing is that even inside xcode, when I open the xib file, it sometimes shows the english version and sometimes the spanish. ¿?
The xibs are not localized, because there is nothing more to localize in there, just that UIImageView with the png's.
Is it not possible to localize just the png's?
Does anyone know if this issues respond to known bugs?
This png's are named text1.png, text2.png, text3.png ... Could it be something related to the serialized naming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有本地化时默认的 xib 是英语。当它加载时,它会拉入英语资源。因此,除了图像之外,您还需要创建本地化的 xib。或者,对于您的情况,我建议您在 viewDidLoad 中加载并设置正确的图像,因为它只有 10 张图像。维护起来会更容易,因为您不必为所做的每项更改都更新 xib 的每个本地化版本。当您在其中包含更多本地化项目时,就不用再烦恼了。 :)
The default xib when there's no localization is english. When it load it pulls in the english resources. So you need to create the localized xibs in addition to the images. Or, what I'd recommend in your case since it's just 10 images, is to load and set the correct image in viewDidLoad. It'll be easier to maintain since you won't have to update every localized version of the xib for every change you make. Save that headache for when you have more items in one that are localized. :)
好吧,我想我明白了...
(不过,名称应该不是问题)
我对 xib 文件执行了相同的过程。现在一切正常了。我还没有找到任何方法来修复显然没问题的文件的依赖关系或路径,但本地化没有按预期到达它们。但我明白这不应该是这样。
Well, I think that I get it...
(The name should not be a problem, though)
I did the same process with xib files. And everything works now. I haven't found any way to fix dependencies or paths to files that aparently are ok, but the localization doesn't reach them as expected. I understand that this should not be the way, though.