查看“Zope3宝典/国际化软件包”的源代码
来自Ubuntu中文
←
Zope3宝典/国际化软件包
跳到导航
跳到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
=== 18.6 Step VI: Translating Message Strings(18.6 步骤 VI:翻译消息字符串) === Now that we have a Message Catalog Template file, we can finally create a translation. Since we do not have existing message catalogs, you can simply copy the POT template file to the language you want to localize. In Unix you can just do the following from the locales directory:<br> 既然我们已经有了一个Message目录模板文件,那么我们现在就可以着手创建一个翻译。由于现在还没有message目录,您可以拷贝POT模板文件到相应的语言目录。在Unix您可以使用如下命令: <pre><nowiki> 1 cp messageboard.pot de/LC_MESSAGES/messageboard.po </nowiki></pre> Open de/LC_MESSAGES/messageboard.po in you favorite translation tool or a text editor. However, it is strongly recommended to use a gettext-specific translation tool, since it will guarantee format integrity. Some of the choices include KBabel and the Vim/Emacs gettext modes.<br> 用文本编辑器打开de/LC_MESSAGES/messageboard.po文件。在这里,为了保持文件格式的完整性,我们强烈建议您使用专有的gettext翻译工具。比如说Vim/Emacs、KBabel都是些不错的选择。 KBabel seems to be the most advanced tool and develops to become a standard application for localization. It has many functions that make it easy for translators to do their job efficiently. My wife and I have translated many files using KBabel and it is a fantastic tool. It allows you, for example, to walk only through all untranslated or fuzzy strings and helps managing the message strings by providing message numbers and statistics.<br> 高级工具KBabel已经成为进行本地化开发的标准应用程序。它有很多功能可以让翻译工作变得更加容易和高效。我和我妻子使用KBabel翻译了许多的文件,KBabel真是一个让人感到奇妙的工具。举例来说, 它排列所有未翻译或模糊字符串,并且通过提供message编号和统计学来帮助管理message字符串。 After you are done with the translations, save the changes and you should be all set.<br>在做完翻译工作后,保存您所做过的设置。 Great, we have a translation, but what happens if you develop new code and you need to update the template and catalog files? For creating the template you have to do nothing different, since a template can be created over and over from scratch. But this is not so easy with the actual catalogs, since you do not want to loose existing translations. The gettext utilities, that come with every Linux system, have a nice command line tool called msgmerge (for Windows you can just use Cygwin’s version of the gettext packages). msgemerge merges all changes of the POT file into the message catalog, keeping all comments and existing translations intact and even marking changed translations as “fuzzy”.<br> 我们已经有了翻译功能,但当您又开发了新代码,并且需要更新模板和目录文件,遇到这种情况我们需要采取什么样的措施呢?由于模板从一开始就被创建好了,因此创建的模板您不需要有任何改动。不过对于目录文件,为了不遗漏任何存在的翻译,就需要做一些其它的工作。每个Linux系统都提供了gettext实用工具,其中有个叫msgmerge的命令行工具(在Windows下,您能使用gettext软件包Cygwin版)。msgemerge能把所有改变了的POT文件并进了message目录,保留所有的注解和已经存在的未改变的翻译,并且标识被改变的翻译用做"fuzzy"。 Here is how you can use the tool from the locales directory:<br> <pre><nowiki> 1 msgmerge -U de/LC_MESSAGES/messageboard.po ./messageboard.pot </nowiki></pre>
返回
Zope3宝典/国际化软件包
。
导航菜单
页面操作
页面
讨论
阅读
查看源代码
历史
页面操作
页面
讨论
更多
工具
个人工具
登录
导航
首页
最近更改
随机页面
页面分类
帮助
搜索
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息