forked from kfish/sweep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.i18n
66 lines (49 loc) · 2.53 KB
/
README.i18n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
How to do translations for sweep - a quick overview
===================================================
(Includes information from Mathieu Roy and Silvia Pfeiffer)
For more detailed information refer to:
http://www.gnu.org/manual/gettext/index.html
(1) How to create and test a translation for a new language?
------------------------------------------------------------
Grab the po/sweep.pot file and copy it to the new language,
naming the file after a language code as defined by ISO 639:
ll.po (e.g. fr.po), with a possible country-specific adaptation
as in ll_CC.po.
[For the codes, refer to
http://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html#Language-Codes]
Translate the strings in that file and save it in the /po folder.
Edit the "configure.ac" file (in sweep-x.x.x folder), adding the
new language to the "ALL_LINGUAS directive.
Should look like this :
ALL_LINGUAS="fr se de"
AM_GNU_GETTEXT
The next "configure" will include the new language, the next
"make dist" will create the machine-readable translation, and the
next "make install" will copy it to the system folder where
gettext can find it.
Testing the new translation goes via setting of environment
variables (LANG is usually enough).
Mathieu recommends:
[user@host /]$ export LANG="fr_FR"&&LC_ALL="fr"&&LINGUAS="fr"
(configures this terminal until you close it)
[user@host /]$ sweep
(should work in french)
(2) How to keep the code and its translations up to date?
---------------------------------------------------------
When coding, keep marking displayed text with _("blah") where function
calls are possible or N_("blah") for statically defined strings. Where
the string is actually used in the program, you need to put another
_(variable) around it! A proposed guideline from gnu.org is to use
format strings instead of string concatenation and to keep sentences
within one string.
CAUTION: Be aware that when you mark a string with N_("blah"), this
only marks it for translation.
When creating new code files (.[ch]) with translatable strings in
them, they need to be added manually to the po/POTFILES.in file.
The next "configure" will then automatically take care of creating
the po/POTFILES file and the "make" thereafter will create the
updated po/sweep.pot file. For merging those updated strings into
existing translations, a "make dist" is required.
When a translator updates his/her translation file, copy it back to
the /po directory. It will be compiled into machine-readable form with
the next "make dist" and installed with the next "make install".