Changes

From Gramps

Translating Gramps/zh

No change in size, 23:44, 25 September 2025
no edit summary
{{languages|Translating Gramps}}
[[Category:Zh:Documentation]]
 
如何翻译 GRAMPS Gramps ! Tips for translators of the GRAMPS Gramps program.
GRAMPS Gramps 翻译者注意事项。
==Gettext file format==
原文:
Translating GRAMPS Gramps into a new language means translating English strings used in the GRAMPS Gramps interface. To put it shortly, this amounts to
# obtaining the gramps.pot file with the strings to be translated,
# translating the strings in the template, and
译文:
翻译GRAMPS为一种新的语言,意味着翻译在GRAMPS界面的英语字符串。 翻译Gramps为一种新的语言,意味着翻译在Gramps界面的英语字符串。 简而言之,这意味着
# 获取包含着待翻译的gramps.pot文件,
# 在模板中翻译字符串,
原文:
* Download <code>gramps.pot</code> from GRAMPS Gramps SVN repository, see [[Brief_introduction_to_SVN| the introduction to SVN]].
* Look for <code>gramps.pot</code> in the directory <code>gramps{{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 从Gramps SVN 仓库下载 <code>gramps.pot</code>,参照[[Brief_introduction_to_SVN| the introduction to SVN]].
* 在<code>gramps{{stable_branch}}/po</code> 目录中搜索<code>gramps.pot</code> ,或者你在trunk 版本中的<code>trunk/po</code>目录搜索<code>gramps.pot</code>。
* Copy <code>gramps.pot</code> to the file named <code>lang.po</code>, according to the language you are translating into (<code>fr.po</code> for French, <code>ru.po</code> for Russian, etc.)
* Use [http://gtranslator.sourceforge.net GTtranslator] (GNOME), [http://kbabel.kde.org/ KBabel] (KDE), Emacs po-mode, [http://translate.sourceforge.net/wiki/pootling/index pootling] (GNU/Linux, windows), [http://www.poedit.net/ poedit] (GNU/Linux, OSX, windows), or any similar tool designed for translating <code>.po</code> files. If you do not like any of these tools, you can use any text editor to translate messages.
* Even though GRAMPS Gramps uses UNICODE (UTF-8) for its character set, you may use your native character set for your translation. Just make sure you specify the character set you are using in the <code>Content-Type</code> line in the <code>.po</code> file. GRAMPS Gramps will handle the conversion to UNICODE.
译文:
* 拷贝 <code>gramps.pot</code> 到文件,以 <code>lang.po</code>来命名, 基于你要翻译的语言 (<code>fr.po</code> 用于法语翻译 , <code>ru.po</code> 用于俄语翻译, 等等。)
* 使用[http://gtranslator.sourceforge.net GTtranslator] (GNOME), [http://kbabel.kde.org/ KBabel] (KDE), Emacs po-mode, [http://translate.sourceforge.net/wiki/pootling/index pootling] (GNU/Linux, windows), [http://www.poedit.net/ poedit] (GNU/Linux, OSX, windows), 或者任何相似的工具,设计用于翻译 <code>.po</code> 文件. 如果你不喜欢任何以上工具,你可以使用任何文本编辑器来翻译信息。
* 如果GRAMPS 如果Gramps 使用 UNICODE (UTF-8) 作为它的字符设置,你也可以使用你的本地字符设置。仅仅需要在<code>.po</code> 文件中的<code>Content-Type</code> 行,确认你所使用的字符设置。 GRAMPS Gramps 将会处理UNICODE字符的转换。
===Context===
原文:
As an extension to standard gettext, strings in GRAMPS Gramps can have a context prefix. This prefix should '''not''' be translated, and just be deleted in the translation. More info and an example [[#Translation context|further down]].
As a special context, you will see the manual context, eg :
译文:
作为标准gettext的一个扩展,在GRAMPS中的字串有一个语境的前缀。 作为标准gettext的一个扩展,在Gramps中的字串有一个语境的前缀。 这个前缀不应该被翻译,并且应该在
译文中北删除。例如[[#Translation context|further down]]。
===升级你的翻译===
原文:
If you have submitted a translation, changes are that after some weeks/months, new strings are added to GRAMPSGramps, implying you need to update your translation file.
译文:
如果你已经提交了翻译,经过了几个星期/几个月有了新的修订,新的字符串被添加到了GRAMPS内,表明你需要升级你的翻译文档。几个月有了新的修订,新的字符串被添加到了Gramps内,表明你需要升级你的翻译文档。
原文:
Assuming you have obtained originally the GRAMPS Gramps source tree as explained in [[Brief introduction to SVN]]. Now:
译文:
假如你已经在[[Brief introduction to SVN]]里面获得了以前的GRAMPS源代码树中的说明里面获得了以前的Gramps源代码树中的说明. 现在:
原文:
* 通过执行下面的命令从SVN上更新你的gramps树<pre>svn up</pre>
原文:from the root GRAMPS Gramps svn directory. This will download an updated <code>gramps.pot</code> file.
译文:这个命令将从GRAMPS 译文:这个命令将从Gramps svn的根目录下载更新<code>gramps.pot</code>文件.
原文:
原文:
Make sure you only install from within the po directory, or you will install the development version of GRAMPSGramps, which is not supported and for testing only!
译文:
确认你仅仅在po目录内安装,或者你可以安装开发版本的GRAMPS,但是不支持并且仅仅作为测试用!确认你仅仅在po目录内安装,或者你可以安装开发版本的Gramps,但是不支持并且仅仅作为测试用!
==== Running trunk with your translation ====
原文:
The current GRAMPS Gramps trunk as of February 2009 by default looks for the i18n data under <code>/usr/local/share/locale</code>. So you can use:
译文:
This will install the .mo files under /usr/local/share/locale/xx/LC_MESSAGES, since the default prefix is /usr/local
===== $GRAMPSI18N GrampsI18N =====
Actually you don't even need to install the files in order to test them. This is useful because you can develop GRAMPS Gramps without needing superuser privileges. Bear in mind the GRAMPS Gramps i18n proccess goes something like this when you use trunk:
* when you type <code>make</code> in the source tree root (/home/user/trunk e.g.) all the trunk/po/*.po files are compiled into trunk/po/*.gmo files.
* when you type <code>make install</code> inside the /home/user/trunk/po directory, these .gmo files are copied to /usr/local/share/locale/xx/LC_MESSAGES as gramps.mo files.
But you can change the place where GRAMPS Gramps looks for these files by altering the environment variable $GRAMPSI18NGrampsI18N. So you could also for intance do something like this and avoid the <code>make install</code> step: (if you are using csh or tcsh the syntax would be a little different)
[user@localhost /home/user/trunk]$ mkdir -p po/en_GB/LC_MESSAGES
[user@localhost /home/user/trunk]$ cp po/en_GB.gmo po/en_GB/LC_MESSAGES/gramps.mo
[user@localhost /home/user/trunk]$ cd src
[user@localhost /home/user/trunk/src]$ GRAMPSI18NGrampsI18N=$PWD/../po LANG=en_GB.UTF-8 python gramps.py
===== Just testing your translation =====
==Translating wiki manual==
To have the link working in GRAMPSGramps, you need to have or edit the GrampsDisplay.py file to contain your language.
On line 30 of that file, you see:
*Every 'manual|...' entry in the gramp.pot file refers to a section in the manual, so make sure to use good section headings so this does not change too much over time.
Note that reports/tools link to a section in the page with the same name as the report name in GRAMPSGramps.
*You should be able to edit directly on wiki or using tools like [http://translate.sourceforge.net/wiki/toolkit/txt2po txt2po]. Also previous gettext file for the manual and [http://en.wikipedia.org/wiki/Translation_memory Translation Memory] may help you to upgrade deprecated/old gettext files.
==Translating third-party plugins==
As [[Third-party Plugins]] are not officially part of GRAMPS Gramps and are not supported by the GRAMPS Gramps Developers but give users more tools to work with your genealogy data in GRAMPSGramps, we can translate them !
Trying to avoid duplicate strings which could generate conflicts, [[Media:additional.pot.gz|here an additional template]]. We should be able to copy/paste references at the end of main translation file for supporting translation on third-party plugins.
'''粗体文字'''
 
[[Category:Zh:Documentation]]
15,091
edits

Navigation menu