Changes

Jump to: navigation, search

Translating Gramps

508 bytes added, 06:25, 16 November 2012
m
Installing your translation
Tips for translators of the GRAMPS program.
 
The page [[Coding_for_translation|coding for translation]] may also be of interest to translators.
 
[[Category:Translators/Categories]][[Category:Developers/General]]
===Obtaining gramps.pot===
* 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>gramps33gramps{{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>.
===Translating messages===
===Testing your <code>.po</code> file===
In the directory <code>gramps33gramps{{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.
====check_po====
In the directory <code>gramps33gramps{{stable_branch}}/po</code> or the <code>trunk/po</code> run the command: <pre>  ./check_po --skip-fuzzy lang.po</pre> or <pre> python check_po --skip-fuzzy lang.po > lang</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..
File: nl.po
====statistics====
In the directory <code>gramps33gramps{{stable_branch}}/po</code> or the <code>trunk/po</code> run the command: <pre>msgfmt --statistics lang.po</pre> or <pre>msgfmt.exe --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.
make update-po
in the <code>po</code> directory. This assumes that you have already succesfully configured the source. Note, this command ignores <code>--no-wrap</code> option, so not practical for SVN diffs.
 
{{man warn|Environment change|For trunk, see [[Translation_environment4|new environment]].}}
===Testing your update===
You can test your update easily with the above mentioned '''check_po''' file. If you downloaded this file, just do:
<pre> python check_po --skip-fuzzy newlang.po</pre>. If everything is ok, the output will be something like this:
File: newlang.po
Template total: 3075
===Installing your translation===
 
{{man warn|Environment change|For trunk, see [[Translation_environment4|new environment]].}}
You want to use the new translation immediately, and systemwide?
make --prefix=/usr install #as root !
This should install your translations to <code>''/usr/share/locale/xx{lang}/LC_MESSAGES/gramps.mo</code>'', with xx {lang} being your language. You could of course copy your files manually to that dir with the gramps.mo name.
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!
==== Running trunk with your translation ====
The current GRAMPS trunk as of February 2009 by default looks for the i18n data are often under <code>/usr/local''../share/locale</code>'' according to the default prefix. So you can use:
./autogen.shSo you can use: make cd popython setup.py build make python setup.py install #as root !
This will install the .mo files under /usr/local''../share/locale/xx/LC_MESSAGES'', since according to the default prefix is /usr/localset.
or
python setup.py build python setup.py install --root=/home/joe/autogen.sh gramps-trunk --prefix="/home/...joe/gramps4" make make install --enable-packager-mode #as simple user !
This will install Gramps and translations under your ''/home/...'' directory.
===== $GRAMPSI18N (for your locale) =====
Actually you don't even need to install the files in order to test them. This is useful because you can develop GRAMPS without needing superuser privileges. Bear in mind the GRAMPS i18n process goes something like this when you use trunk as of February 2009:
* when you type <code>makepython build</code> in the source tree root (/home/user/trunk e.g.) all the trunk/po/*.po files are compiled into trunk/pobuild/mo/{lang}/*.gmo mo files.* when you type <code>make python install</code> inside the /home/user/trunk/po directory, these .gmo mo files are copied to /usr/local{prefix}/share/locale/xx{lang}/LC_MESSAGES as gramps.mo files.
But you can change the place where GRAMPS looks for these files by altering the environment variable $GRAMPSI18N. So you could also for instance do something like this and avoid the <code>make python setup 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 srcgramps [user@localhost /home/user/trunk/src]$ GRAMPSI18N=$PWD/../po LANG=en_GB.UTF-8 python gramps.py
===== gramps.sh =====
Note that reports/tools link to a section in the page with the same name as the report name in GRAMPS.
*You should be able to edit directly on wiki or using tools like [http://translate.sourceforge.net/wiki/toolkit/txt2po txt2po] or [http://po4a.alioth.debian.org/ po4a]. 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.
==Language specific pages==

Navigation menu