Difference between revisions of "Translation environment4"
m (→How it works) |
m (→How it works) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This page describes the next translation environment. | This page describes the next translation environment. | ||
+ | |||
+ | See [[GEPS_026:_Replace_'make'_for_Gramps_build]]. ''work in progress'' (testing stage) | ||
Could be used for Gramps '''4.0.x'''. | Could be used for Gramps '''4.0.x'''. | ||
Line 5: | Line 7: | ||
==How it works== | ==How it works== | ||
− | * python[http://docs.python.org/library/xml.etree.elementtree.html] and xgettext[http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html] | + | * intltool (perl), gettext |
+ | |||
+ | intltool-update -p | ||
+ | or run: | ||
+ | genpot.sh | ||
+ | |||
+ | * python, ElementTree[http://docs.python.org/library/xml.etree.elementtree.html] and xgettext[http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/xgettext-Invocation.html] | ||
python update_po.py -h | python update_po.py -h | ||
python update_po.py --help | python update_po.py --help | ||
+ | python update_po.py [options] | ||
+ | |||
+ | For generating a new template: | ||
+ | python update_po.py -p | ||
* ''parser'' generates a new template and also provides some common features. | * ''parser'' generates a new template and also provides some common features. | ||
** test flag (-t) will test if 'python' and 'gettext' are properly installed. | ** test flag (-t) will test if 'python' and 'gettext' are properly installed. | ||
* ''extract'' options are everything around extraction for message strings. | * ''extract'' options are everything around extraction for message strings. | ||
− | ** xml flag (-x) will extract messages from xml based | + | ** xml flag (-x) will extract messages from xml based, ini and desktop files. |
** glade flag (-g) will extract messages from glade file format only. | ** glade flag (-g) will extract messages from glade file format only. | ||
** clean flag (-c) will remove created files. | ** clean flag (-c) will remove created files. | ||
** pot flag (-p) will create a new catalog. | ** pot flag (-p) will create a new catalog. | ||
− | * ''update'' options are everything around update for translation | + | * ''update'' options are everything around update for translation file(s). |
− | ** merge flag (-m) will merge lang.po | + | ** merge flag (-m) will merge '''lang.po file(s)''' with last catalog. |
− | ** check flag (-k) will check lang.po | + | ** check flag (-k) will check '''lang.po file(s)''', will try to compile and will also use ''check_po'' script. |
− | * ''translation'' options are some informations about translation | + | * ''translation'' options are some informations about one translation file. |
− | ** untranslate flag (-u) will list untranslated messages. | + | ** untranslate flag (-u) will list untranslated messages on '''lang.po file'''. |
− | ** fuzzy flag (-f) will list fuzzy messages. | + | ** fuzzy flag (-f) will list fuzzy messages on '''lang.po file'''. |
===Files and directory=== | ===Files and directory=== | ||
− | Like with [[Translation_environment22#Files_and_directory|previous environment]], we need to list files with translation strings for retrieving messages and generating a 'po/gramps.pot' file. | + | Like with [[Translation_environment22#Files_and_directory|previous environment]], we need to list files with translation strings for retrieving messages and generating a 'po/gramps.pot' file. Process is now only using ''gettext'' and ''python''. |
− | * | + | * gettext, 'POTFILES.in' and 'POTFILES.skip' files |
− | If you want a script to take your translatable strings into account, you must add your source file path in the file : <code>po/ | + | If you want a script to take your translatable strings into account, you must add your source file path in the file : <code>po/POTFILES.in</code>. For this report example, you should add: |
... | ... | ||
− | + | gramps/plugins/leak.py | |
− | + | gramps/plugins/mediamanager.py | |
− | + | gramps/plugins/myreport.py # <------ | |
− | + | gramps/plugins/narrativeweb.py | |
− | + | gramps/plugins/patchnames.py | |
... | ... | ||
+ | |||
[[Category:Translators/Categories]] | [[Category:Translators/Categories]] | ||
[[Category:Developers/General]] | [[Category:Developers/General]] |
Revision as of 09:14, 5 October 2012
This page describes the next translation environment.
See GEPS_026:_Replace_'make'_for_Gramps_build. work in progress (testing stage)
Could be used for Gramps 4.0.x.
How it works
- intltool (perl), gettext
intltool-update -p
or run:
genpot.sh
python update_po.py -h python update_po.py --help python update_po.py [options]
For generating a new template:
python update_po.py -p
- parser generates a new template and also provides some common features.
- test flag (-t) will test if 'python' and 'gettext' are properly installed.
- extract options are everything around extraction for message strings.
- xml flag (-x) will extract messages from xml based, ini and desktop files.
- glade flag (-g) will extract messages from glade file format only.
- clean flag (-c) will remove created files.
- pot flag (-p) will create a new catalog.
- update options are everything around update for translation file(s).
- merge flag (-m) will merge lang.po file(s) with last catalog.
- check flag (-k) will check lang.po file(s), will try to compile and will also use check_po script.
- translation options are some informations about one translation file.
- untranslate flag (-u) will list untranslated messages on lang.po file.
- fuzzy flag (-f) will list fuzzy messages on lang.po file.
Files and directory
Like with previous environment, we need to list files with translation strings for retrieving messages and generating a 'po/gramps.pot' file. Process is now only using gettext and python.
- gettext, 'POTFILES.in' and 'POTFILES.skip' files
If you want a script to take your translatable strings into account, you must add your source file path in the file : po/POTFILES.in
. For this report example, you should add:
... gramps/plugins/leak.py gramps/plugins/mediamanager.py gramps/plugins/myreport.py # <------ gramps/plugins/narrativeweb.py gramps/plugins/patchnames.py ...