Changes

Jump to: navigation, search

Translating Gramps/zh

2,083 bytes added, 05:54, 4 February 2013
m
Patsyblefebre moved page Translating GRAMPS/zh to Translating Gramps/zh: Gramps
{{languages|Translating GRAMPSGramps}}
[[Category:Zh:Documentation]]
 == 如何翻译 GRAMPS !
Tips for translators of the GRAMPS program.
# translating the strings in the template, and
# getting the translated file uploaded into gramps SVN repository.
Another avenue of translation is translating the documentation. This is a different and lengthy process and it is decribed in our [[Translating the Gramps User manual]] page. Here we will concentrate on the interface translation only.
译文:
原文:
* Download <code>gramps.pot</code> from GRAMPS SVN repository, see [[Brief_introduction_to_SVN| the introduction to SVN]].
* Look for <code>gramps.pot</code> in the directory <code>gramps31gramps{{stable_branch}}/po</code> or if you looking for the trunk version look for <code>gramps.pot</code> in the directory <code>trunk/po</code>.
译文:
* 从GRAMPS SVN 仓库下载 <code>gramps.pot</code>,参照[[Brief_introduction_to_SVN| the introduction to SVN]].
* 在<code>gramps31gramps{{stable_branch}}/po</code> 目录中搜索<code>gramps.pot</code> ,或者你在trunk 版本中的<code>trunk/po</code>目录搜索<code>gramps.pot</code>。
===Translating messages===
原文:
In the directory <code>gramps31gramps{{stable_branch}}/po</code> or the <code>trunk/po</code> run the command: <pre>make</pre> If there are errors in your po file, this will fail and give you an error message. You should correct these errors. If you have trouble understanding the error, try to run the next test, which might give a more verbose output.
译文:
在目录<code>gramps31gramps{{stable_branch}}/po</code> 或者 <code>trunk/po</code> 中运行命令:<pre>make</pre> 如果在你的 po 文件中有错误,将会编译失败,并且反馈错误信息。你应该纠正这些错误。 如果你无法理解错误,尝试下一个测试,可能会给你更加冗长的输出。
====check_po====
原文
In the directory <code>gramps31gramps{{stable_branch}}/po</code> or the <code>trunk/po</code> run the command: <pre>./check_po lang.po</pre> or <pre>python check_po lang.po > lang</pre> or <pre>alternative under Windows OS ???</pre> where lang is your language code. This will give you errors in your translation, information on badly translated phrases, ... the output could resemble something like this..
译文:
在目录 <code>gramps31gramps{{stable_branch}}/po</code> 或者 <code>trunk/po</code>中运行命令: <pre>./check_po lang.po</pre> 或者 <pre>python check_po lang.po > lang</pre> 或者 <pre>alternative under Windows OS ???</pre> 其中 lang是你语言的编码。 这将会在你的翻译中提供更多的错误信息,包括不适当的翻译句型,...输出可能类似以下:
原文:
In the directory <code>gramps31gramps{{stable_branch}}/po</code> or the <code>trunk/po</code> run the command: <pre>msgfmt --statistics lang.po</pre> where lang is your language code. This should not throw an error.
Basically this gives the same info in a condensed format: 3533 translated messages, 125 fuzzy translations, 12 untranslated messages.
译文:
在目录 <code>gramps31gramps{{stable_branch}}/po</code> 或者 <code>trunk/po</code> 下运行命令:<pre>msgfmt --statistics lang.po</pre> 其中 lang 代表你的语言编码。 这应该不会发生错误。
大体上说,这会显示一种紧凑的格式:3533 已翻译,125 模糊翻译,12 未翻译。
译文:
假如你已经获得了以前的GRAMPS源代码树中的说明在假如你已经在[[Brief introduction to SVN]]里面里面获得了以前的GRAMPS源代码树中的说明. 现在:
原文:
译文:这个命令将从GRAMPS svn的根目录下载更新<code>gramps.pot</code>文件.
原文: * Use your outdated translation to translate the strings that did not change: 译文: * 使用你原有的翻译,来替代本次未改变的字符串的翻译:<pre>msgmerge lang.po gramps.pot -o newlang.po</pre> or (或者)  <pre>msgmerge --no-wrap lang.po gramps.pot -o newlang.po</pre> where  原文:where <code>lang</code> is your language code. The <code>--no-wrap</code> option will prevent changes due to automatic word wrapping, use it if your previous po file was constructed like that. The <code>--no-wrap</code> options allows for more readable SVN diffs.译文: 其中 <code>lang</code> 是你的语言代码。  原文: 
* Translate all untranslated messages in <code>newlang.po</code>. When you are sure everything is right, rename <code>newlang.po</code> as <code>lang.po</code> and check it into SVN as you did with the original file.
译文:
* 在文件<code>newlang.po</code> 中翻译所有未翻译的信息。当你确认所有翻译都正确后,将<code>newlang.po</code> 重命名为 <code>lang.po</code> 并将其放入SVN原文件中检查。
原文
* If command <code>msgmerge</code> is not available on your system, you have to install the <code>}gettext</code> package. For [http://wiki.wxpython.org/index.cgi/Internationalization#head-d8e0d98b64f3878f8bb828aeb41a05bcc6a02cc4 windows users].
译文:
* 如果你的系统不支持命令<code>msgmerge</code>,你需要安装<code>}gettext</code>包。参照For [http://wiki.wxpython.org/index.cgi/Internationalization#head-d8e0d98b64f3878f8bb828aeb41a05bcc6a02cc4 windows 用户]
 
原文:
There is also the make target that does the following:
译文:
make 命令也能实现以下内容:
原文:
* Create new <code>gramps.pot</code> template from the source code files
译文
* 从源代码文件中,创建新的 <code>gramps.pot</code> 模板
cd po
make gramps.pot
原文:
* Updates each <code>po</code> file in the source tree
译文:
* 在源码树中更新每个 <code>po</code>文件
原文:
It may be an overkill for you, but if you feel like using it, you can run:
译文:
这样可能很具有破坏性,但是如果你希望,你可以运行它:
 
make update-po
 
原文:
in the <code>po</code> directory. This assumes that you have already succesfully configured the source.
译文:
在<code>po</code> 目录中运行。此操作假设你已经成功的设定了源。
===Testing your update===
===升级测试===
原文:
You can test your update easily with the above mentioned '''check_po''' file. If you downloaded this file, just do:
译文:
依据以上提到的'''check_po''' 文件,你可以很容易的测试你的更新内容。如果你下载了这个文件,请执行:
 
<pre>python check_po newlang.po</pre>.
原文:
If everything is ok, the output will be something like this:
译文:
如果一切顺利,输出将会类似:
You can test your update easily with the above mentioned '''check_po''' file. If you downloaded this file, just do:
<pre>python check_po newlang.po</pre>. If everything is ok, the output will be something like this:
File: newlang.po
Template total: 3075
===Installing your translation===
===安装你的翻译===原文:
You want to use the new translation immediately, and systemwide?
You can by installing just the contents of the po directory, but you will need to build the source first, so:
 
译文:
你是否希望立即使用新的翻译,并且是整个系统的?
你可以添加po目录的内容,但是你需要先编译源代码,类似:
 
./autogen.sh
make
make --prefix=/usr install #as root !
原文:
This should install your translations to <code>/usr/share/locale/xx/LC_MESSAGES/gramps.mo</code>, with xx being your language. You could of course copy your files manually to that dir with the gramps.mo name.
译文:
这应该把你的翻译安装到<code>/usr/share/locale/xx/LC_MESSAGES/gramps.mo</code>, 其中XX是你的语言。你当然也可以拷贝你的文件到gramps.mo文件名的目录。
 
原文:
Make sure you only install from within the po directory, or you will install the development version of GRAMPS, which is not supported and for testing only!
 
译文:
确认你仅仅在po目录内安装,或者你可以安装开发版本的GRAMPS,但是不支持并且仅仅作为测试用!
==== Running trunk with your translation ====
==== 在trunk中应用你的翻译 ====
原文:
The current GRAMPS trunk as of February 2009 by default looks for the i18n data under <code>/usr/local/share/locale</code>. So you can use:
译文:
 
./autogen.sh

Navigation menu