1
Adding a translation to gperiodic
2
---------------------------------
4
1) Extract the strings from the source
5
--------------------------------------
6
In the gperiodic top level directory, create the .po template (.pot):
8
xgettext -k_ -kN_ *.c *.h -o po/gperiodic.pot
11
2) Update or create .po files
12
-----------------------------
13
If there are any existing translations, XX.po files, then merge them:
16
msgmerge XX.po gperiodic.pot > XX.po.new
19
Or, if this is a new translation, copy the template:
22
cp gperiodic.pot XX.po
27
Edit XX.po to add translations for new strings, fix broken translations,
28
and touch up fuzzy translations.
31
4) Make and install gperiodic with i18n enabled
32
---------------------------------------------
33
If make is run from this directory instead of the top level dir, you must
34
explicitely enable i18n in all the below examples by adding enable_nls=1
39
And for the install step:
41
make install enable_nls=1
43
i18n will be automatically enabled when make is run from the top level dir.
46
In either case, a make install will for each XX.po file create a XX.mo file
49
$LOCALEDIR/XX/LC_MESSAGES/gperiodic.mo
51
If there is no LOCALEDIR environment variable, then the default install
54
/usr/share/locale/XX/LC_MESSAGES/gperiodic.mo
58
But, if you want a different explicit install directory, do for example:
60
make install LOCALEDIR=/usr/local/share/locale
63
export LOCALEDIR=/usr/local/share/locale
67
sh: export LOCALEDIR; LOCALEDIR=/usr/local/share/locale
68
csh: setenv LOCALEDIR /usr/local/share/locale
70
============================================================================
74
A user must have localizations enabled for a translation to be used.
75
To enable a localization, the LANG environment variable should be set
76
via the command line or the shell login startup files.
78
For example, to see the Swedish translation, a user should be able to: