File: README.NLS

package info (click to toggle)
gentoo 0.11.19-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,456 kB
  • ctags: 3,228
  • sloc: ansic: 26,001; makefile: 393; sh: 330
file content (113 lines) | stat: -rw-r--r-- 5,297 bytes parent folder | download
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
							2000-09-14
							Emil Brink

	    gentoo: notes on national language support

0. CAVEAT
At the last moment before release (um, yeah), the I18N stuff was
disabled in the build process. This is because it was far too
fragile when done by hand--it *needs* autoconf, but I can't get
my head around that program at the moment. Sorry. Help welcome.

Therefore, the below is mostly of theoretical interest, since
you can't actually run gentoo with non-English strings right
now, not without poking around in the code and Makefile(s),
at least.

Sorry about that.


1. INTRODUCTION
As of version 0.11.15, gentoo comes with some form of support for
translating it to languages other than English. This support dep-
ends on the presence of the GNU gettext package, or something
functionally equivalent. It has only been tested with GNU gettext.

This document describes how to add support for a new language,
i.e. how to translate gentoo.

I will assume in the following that you as a translator are fami-
liar with the GNU gettext way of translating software. Since I'm
very new to these tools myself, feel free to send corrections/
suggestions for improvements if you spot anything suspicous. :)


2. THE Makefile
There are two new targets in the Makefile that relate directly to
internationalization: "lang" and "langfmt".

When you type "make lang", the Makefile will first generate an
up-to-date "root" PO file ("gentoo.po") by running xgettext on
the C sources. It will then visit all subdirectories in the locale/
directory, and merge the newly created PO file into the existing
PO files there. The merge is done using msgmerge, of course.

If you type "make langfmt", the Makefile will run the msgfmt
program, producing fresh binary message catalogs (MO files) from
your translated PO files. Again, this is done in all subdirect-
ories in locale/. This is what you need to do when a translated
string has changed, and you want to run gentoo to test it out.


3. ADDING LANGUAGES
If you want to translate gentoo into your own language, feel free
to do so. I (the author) am only fluent in Swedish and English, so
I have no ability to translate the software into other languages.
If you want it done, step up and do it yourself.

Please send me a note *before* you begin, however, so that I can
synchronize the efforts. We don't want people to waste their time
doing multiple versions of the same target langauge, right?

The first thing to do is to find out the correct code for the lang-
uage you wish to translate gentoo into. The code is a short stand-
ardized language identifier. For example, the code for English is
"en", for Swedish it is "sv". There are "subcodes" for variants of
languages spoken in e.g. different geographical regions; for example,
in some parts of Finland Swedish is spoken, this dialect is known
as "sv_FI". Once you know your language code, create a subdirectory
under locale/, using the code as the name for the new subdirectory.
Inside that new dir, create another directory called LC_MESSAGES.
Then copy the "root" PO file ("gentoo.po") from the source code
directory into your freshly created dir, open it up in an editor,
and start translating!

3.1 TRANSLATION CREDITS
The last sentence in the first screen of the About window is meant
to contain credits and contact information for the current trans-
lation. The built-in English string that you replace as a trans-
lator is "Using built-in English strings". A recommended format
for the translation is "X translation by Y <y@host>.". The Swedish
translation says "Svensk versttning av Emil Brink", but does
not repeat my e-mail address.
	The strings for the command dialog contain other credits
and web addresses as well. Please include these in your trans-
lation.

3.2 TRANSLATING CONFIGS
Translating gentoo is made harder by the fact that there are many
user-created strings in the configuration file; mainly names (for
e.g. types, styles and commands) and button labels. Before the
translation support was added, gentoo always shipped with an "off-
icial" example config, with all such strings in English. My sugg-
estion is that you modify a copy of this file, and put it in your
language's locale directory.

3.3 UNTRANSLATABLE STRINGS
If you are familiar with using gentoo, you might be surprised when
reading the PO file, and think that some strings are missing from
it. This is correct, but is by design, so don't worry. The command
names (things like DirParent, Move, and SymLinkEdit) are not trans-
latable. This is because I am very much opposed to the idea of
translating programming languages, and tend to think of gentoo's
set of commands as forming a very simple programming language.
	If the command names were to be translated, that would
create a potentially big support problem, as well, since I would
not be able to help users solve problems, unless those users
happen to use a version of gentoo with English command names.
This is a very undesirable situation, which is why the command
names are not meant to be translatable.
	Also, the keywords used in the XML tags in the config file
are not translatable. This, of course, is because it is nice if
users can swap config files with each other, even across language
borders. This leaves translating button labels etc to the user.