如何简化iPhone本地化

如何简化iPhone本地化

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

问题描述

我需要本地化一个用于英语和英语的开发应用程序西班牙语。



尽管我遵循Apple的使用方式NSLocalizedString&为两者创建笔尖,我已经失去了需要进行本地化的新字符串的轨道,并且惊讶地发现当我更改母版时我需要用西班牙语重做笔尖。



(就像这个)



我想知道是否存在更好/替代/更自动化的方式。





或者如果存在一些脚本或工具。

解决方案

这里真的没有一个简单的解决办法。 NIB需要针对每种语言单独布局。在某种程度上,这改善了整体用户界面,因为不同的语言实际上通常需要不同的布局才能看起来最好。俄语和德语在屏幕上比英语更大。中文通常可以小得多,不同的布局看起来更好用汉字。阿拉伯语和希伯来语是从右到左,可能需要彻底改变布局。自动布局很容易,但是通过在所有语言中改变丑陋程度来实现这一点。如果给开发人员轻松选择和开发人员之间的丑陋与困难之间的选择,那么Apple几乎总是会选择后者。也就是说,Apple仍然没有让它变得如此简单。



所以这里的第一课就是保持你的NIB 简单。这在iPhone上比在Mac上更容易,因为iPhone没有绑定,iPhone NIB通常也更简单。您还可以对具有非常少量文本(如标题)的NIB使用文本注入。 文本注入是一种奇特的说法,在加载视图时使用标签的插座并将其设置为本地化文本。



ibtool能够从NIB中拔出绳子并将它们推回来,这可能会有所帮助。我使用了iLocalize,这对于使用合同本地化程序很有帮助,但对你所谈论的问题没有任何帮助。



我试图摆脱NIB只是使用代码,认为它会让事情变得更容易,但实际上并没有。在NIB中布置每种语言比提出在所有语言中看起来都不错的布局逻辑更容易(参见第一段)。文本注入仅在少数几个地方有用。如果您可以将NIB拆分为需要本地化的NIB和不需要本地化的NIB,这可能会有所帮助。在iPhone上,我发现不到一半的NIB实际上有文本或本地化图像。



当然你应该读,但我很遗憾地说没有简单的答案你的问题。运送产品本地化为19种语言,我感到很痛苦。


I need to localiza a in development app for English & Spanish.

Despite the fact I follow the Apple way of use NSLocalizedString & create nibs for both, I already lost the track of the new string that need to get localized and found with surprise that I need to redo the nibs in spanish when I change the master.

(Just like this http://www.gigliwood.com/weblog/Cocoa/A_Great_Need_for_Be.html)

I wonder if exist a better/alternative/more automated way.

I know the use of gettext & poedit and wonder if something like that can be used.

Or if exist some script or tool for this.

解决方案

There really isn't an easy fix here. NIBs need to be individually laid out for every language. To some extent, this improves overall user interface, because different languages actually often need different layout to look their best. Russian and German are much "larger" languages in screen real estate than English. Chinese can often be much smaller and a different layout looks better with Chinese characters. Arabic and Hebrew are right-to-left and may need radical changes to layout. Automated layout is easy, but achieves this by being varying levels of ugly in all languages. When given the choice between easy for the developer and ugly vs. difficult for the developer and beautiful, Apple almost always chooses the latter. That said, Apple has still not made it nearly as easy as they could.

So the first lesson here is to keep your NIBs simple. This is easier on iPhone than on Mac because iPhone doesn't have bindings and iPhone NIBs are generally simpler anyway. You can also use text injection for NIBs that have very small amounts of text (like a title). "Text injection" is a fancy way of saying "use an outlet for the label and set it to the localized text when you load the view."

ibtool is able to pull strings out of NIBs and also shove them back in, which can be helpful. I've used iLocalize, which is helpful for working with contract localizers, but doesn't really help with the problem you're talking about.

I tried getting rid of NIBs and just using code, thinking it would make things easier, but it really didn't. It was easier to lay out each language in the NIB than to come up with layout logic that would look good in all languages (see first paragraph). Text injection was only useful in a handful of places. If you can split your NIBs up into ones that need to be localized and those that don't, that can be helpful. On iPhone, I found that less than half of my NIBs actually had text or localized images in them.

Of course you should read Internationalization Programming Topics, but I'm sorry to say there really is no easy answer to your problem. Shipping products localized in 19 languages, I feel your pain.

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

09-02 08:27