2646
by Ulrik Sverdrup
doc: Split technical user documentation into parts |
1 |
Localization
|
2 |
============
|
|
3 |
||
4 |
||
5 |
kupfer is translated using gettext and it is managed in the build system |
|
2647
by Ulrik Sverdrup
doc: Update PluginAPI |
6 |
using ``intltool``. Translation messages are located in the ``po/`` |
2646
by Ulrik Sverdrup
doc: Split technical user documentation into parts |
7 |
directory. |
8 |
||
9 |
Kupfer's localizations are listed among GNOME's modules. Its homepage |
|
10 |
is: |
|
11 |
||
12 |
http://l10n.gnome.org/module/kupfer/ |
|
13 |
||
14 |
You can download the latest version of your language's translation file |
|
15 |
there, if Kupfer is already translated to your language. |
|
16 |
||
17 |
.. contents:: |
|
18 |
||
2647
by Ulrik Sverdrup
doc: Update PluginAPI |
19 |
To create a new translation
|
2646
by Ulrik Sverdrup
doc: Split technical user documentation into parts |
20 |
---------------------------
|
21 |
||
22 |
Go into the directory ``po``
|
|
23 |
||
24 |
1. Add the language code ``$LANG`` to the file ``LINGUAS`` |
|
25 |
2. Run ``intltool-update --pot``, and copy ``untitled.pot`` to ``$LANG.po`` |
|
26 |
3. Edit and check the whole file header:
|
|
27 |
||
28 |
+ Write in yourself as author
|
|
29 |
+ Check ``plurals`` (copy from a language that you know uses the same |
|
30 |
number of plural forms, or look up in GNOME's translation pages.) |
|
31 |
+ Replace everything written in CAPS
|
|
32 |
||
33 |
Fill in the charset used; Kupfer translations *must* use the UTF-8 encoding.
|
|
34 |
||
35 |
When the header is filled-in, go to `To update or check an existing |
|
36 |
translation`_ |
|
37 |
||
38 |
||
39 |
To update or check an existing translation
|
|
40 |
------------------------------------------
|
|
41 |
||
42 |
Go to your Kupfer source directory. |
|
43 |
||
44 |
Here we will call your language ``$LANG``. You should use a two or
|
|
45 |
four-letter code for your language instead of ``$LANG``, for example
|
|
46 |
"de" for German or "pt_BR" for Brazilian Portuguese. |
|
47 |
||
48 |
Go to the translation directory ``po``:: |
|
49 |
||
50 |
cd po/
|
|
51 |
||
52 |
To update and check the translation file, run::
|
|
53 |
||
54 |
intltool-update $LANG
|
|
55 |
||
56 |
Now check and edit ``$LANG.po``. Search for all messages marked "fuzzy",
|
|
57 |
and remove the word "fuzzy" from them when they are done. |
|
58 |
||
59 |
Continue running ``intltool-update $LANG`` and check that you have 0
|
|
60 |
fuzzy and 0 untranslated, then you're finished. |
|
61 |
||
62 |
This will also check consistency of the file, so that you know that all |
|
63 |
your syntax is correct. |
|
64 |
||
65 |
If you want to send in the translation to a repository, or as a patch, |
|
66 |
you can use git if you have a checked-out copy of kupfer::
|
|
67 |
||
68 |
git add po/$LANG.po
|
|
69 |
git commit -m "$LANG: Updated translation"
|
|
70 |
||
71 |
# now we create a patch out of the latest change
|
|
72 |
git format-patch HEAD^
|
|
73 |
||
74 |
You can send the patch, or the whole file, to the mailing list |
|
75 |
kupfer-list@gnome.org. |
|
76 |
||
77 |
To try the new translation
|
|
78 |
--------------------------
|
|
79 |
||
80 |
Make sure the translation is listed in ``po/LINGUAS``.
|
|
81 |
||
82 |
To try it, you have to install kupfer with ``./waf install``, then you
|
|
83 |
can run kupfer as normal. |
|
84 |
||
85 |
.. note:: |
|
86 |
||
87 |
If you run ``./kupfer-run`` from the source directory it won't
|
|
88 |
find the installed translations unless you make a symlink called |
|
89 |
``locale`` to the installed location (for example
|
|
90 |
``~/.local/share/locale`` if install prefix was ``~/.local``):: |
|
91 |
||
92 |
$ ln -s ~/.local/share/locale
|
|
93 |
||
94 |
.. vim: ft=rst tw=72 et sts=4
|
|
95 |
.. this document best viewed with rst2html
|
|
96 |
||
97 |