~ubuntu-branches/ubuntu/breezy/gettext/breezy

« back to all changes in this revision

Viewing changes to gettext-runtime/doc/nls.texi

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-03-14 17:40:02 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314174002-p1ad5ldve1hqzhye
Tags: 0.14.1-2
* Added libexpat1-dev to Build-Depends, for glade support.
* Added libc0.1-dev to Build-Depends, for GNU/kFreeBSD.
* Removed special-casing of knetbsd-gnu in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@node Translation Intro
 
2
@chapter Notes on the Free Translation Project
 
3
 
 
4
@set STATUS January 2004
 
5
 
 
6
Free software is going international!  The Free Translation Project is
 
7
a way to get maintainers of free software, translators, and users all
 
8
together, so that will gradually become able to speak many languages.
 
9
A few packages already provide translations for their messages.
 
10
 
 
11
If you found this @file{ABOUT-NLS} file inside a distribution, you
 
12
may assume that the distributed package does use GNU @code{gettext}
 
13
internally, itself available at your nearest GNU archive site.  But you
 
14
do @emph{not} need to install GNU @code{gettext} prior to configuring,
 
15
installing or using this package with messages translated.
 
16
 
 
17
Installers will find here some useful hints.  These notes also explain
 
18
how users should proceed for getting the programs to use the available
 
19
translations.  They tell how people wanting to contribute and work
 
20
at translations should contact the appropriate team.
 
21
 
 
22
When reporting bugs in the @file{intl/} directory or bugs which may
 
23
be related to internationalization, you should tell about the version
 
24
of @code{gettext} which is used.  The information can be found in
 
25
the @file{intl/VERSION} file, in internationalized packages.
 
26
 
 
27
@menu
 
28
* Configuration advice::
 
29
* INSTALL Matters::
 
30
* Using This Package::
 
31
* Translating Teams::
 
32
* Available Packages::
 
33
* Using gettext in own code::
 
34
@end menu
 
35
 
 
36
@node Configuration advice
 
37
@section Quick configuration advice
 
38
 
 
39
If you want to exploit the full power of internationalization, you
 
40
should configure it using
 
41
 
 
42
@example
 
43
./configure --with-included-gettext
 
44
@end example
 
45
 
 
46
@noindent
 
47
to force usage of internationalizing routines provided within this
 
48
package, despite the existence of internationalizing capabilities in the
 
49
operating system where this package is being installed.  So far, only
 
50
the @code{gettext} implementation in the GNU C library version 2
 
51
provides as many features (such as locale alias, message inheritance,
 
52
automatic charset conversion or plural form handling)
 
53
as the implementation here.  It is also not possible to offer this
 
54
additional functionality on top of a @code{catgets} implementation.
 
55
Future versions of GNU @code{gettext} will very likely convey even more
 
56
functionality.  So it might be a good idea to change to GNU
 
57
@code{gettext} as soon as possible.
 
58
 
 
59
So you need @emph{not} provide this option if you are using GNU libc 2 or
 
60
you have installed a recent copy of the GNU gettext package with the
 
61
included @file{libintl}.
 
62
 
 
63
 
 
64
@node INSTALL Matters
 
65
@section INSTALL Matters
 
66
 
 
67
Some packages are @dfn{localizable} when properly installed; the
 
68
programs they contain can be made to speak your own native language.
 
69
Most such packages use GNU @code{gettext}.  Other packages have their
 
70
own ways to internationalization, predating GNU @code{gettext}.
 
71
 
 
72
By default, this package will be installed to allow translation of
 
73
messages.  It will automatically detect whether the system already
 
74
provides the GNU @code{gettext} functions.  If not, the GNU
 
75
@code{gettext} own library will be used.  This library is wholly
 
76
contained within this package, usually in the @file{intl/} subdirectory,
 
77
so prior installation of the GNU @code{gettext} package is @emph{not}
 
78
required.  Installers may use special options at configuration time for
 
79
changing the default behaviour.  The commands:
 
80
 
 
81
@example
 
82
./configure --with-included-gettext
 
83
./configure --disable-nls
 
84
@end example
 
85
 
 
86
@noindent
 
87
will respectively bypass any pre-existing @code{gettext} to use the
 
88
internationalizing routines provided within this package, or else,
 
89
@emph{totally} disable translation of messages.
 
90
 
 
91
When you already have GNU @code{gettext} installed on your system and
 
92
run configure without an option for your new package, @code{configure}
 
93
will probably detect the previously built and installed @file{libintl.a}
 
94
file and will decide to use this.  This might be not what is desirable.
 
95
You should use the more recent version of the GNU @code{gettext}
 
96
library.  I.e. if the file @file{intl/VERSION} shows that the library
 
97
which comes with this package is more recent, you should use
 
98
 
 
99
@example
 
100
./configure --with-included-gettext
 
101
@end example
 
102
 
 
103
@noindent
 
104
to prevent auto-detection.
 
105
 
 
106
The configuration process will not test for the @code{catgets} function
 
107
and therefore it will not be used.  The reason is that even an
 
108
emulation of @code{gettext} on top of @code{catgets} could not provide
 
109
all the extensions of the GNU @code{gettext} library.
 
110
 
 
111
Internationalized packages have usually many @file{po/@var{ll}.po}
 
112
files, where @var{ll} gives an @w{ISO 639} two-letter code
 
113
identifying the language.  Unless translations have been forbidden
 
114
at @code{configure} time by using the @samp{--disable-nls} switch,
 
115
all available translations are installed together with the package.
 
116
However, the environment variable @code{LINGUAS} may be set, prior
 
117
to configuration, to limit the installed set.  @code{LINGUAS} should
 
118
then contain a space separated list of two-letter codes, stating
 
119
which languages are allowed.
 
120
 
 
121
@node Using This Package
 
122
@section Using This Package
 
123
 
 
124
@c --
 
125
@c FIXME: rewrite to document the aliases.
 
126
@c --
 
127
As a user, if your language has been installed for this package, you
 
128
only have to set the @code{LANG} environment variable to the appropriate
 
129
@samp{@var{ll}_@var{CC}} combination.  Here @samp{@var{ll}} is an
 
130
@w{ISO 639} two-letter language code, and @samp{@var{CC}} is an
 
131
@w{ISO 3166} two-letter country code.  For example, let's suppose that you
 
132
speak German and live in Germany.  At the shell prompt, merely execute
 
133
@w{@samp{setenv LANG de_DE}} (in @code{csh}),
 
134
@w{@samp{export LANG; LANG=de_DE}} (in @code{sh}) or
 
135
@w{@samp{export LANG=de_DE}} (in @code{bash}).  This can be done from your
 
136
@file{.login} or @file{.profile} file, once and for all.
 
137
 
 
138
You might think that the country code specification is redundant.  But in
 
139
fact, some languages have dialects in different countries.  For example,
 
140
@samp{de_AT} is used for Austria, and @samp{pt_BR} for Brazil.  The country
 
141
code serves to distinguish the dialects.
 
142
 
 
143
The locale naming convention of @samp{@var{ll}_@var{CC}}, with
 
144
@samp{@var{ll}} denoting the language and @samp{@var{CC}} denoting the
 
145
country, is the one use on systems based on GNU libc.  On other systems,
 
146
some variations of this scheme are used, such as @samp{@var{ll}} or
 
147
@samp{@var{ll}_@var{CC}.@var{encoding}}.  You can get the list of
 
148
locales supported by your system for your country by running the command
 
149
@samp{locale -a | grep '^@var{ll}'}.
 
150
 
 
151
Not all programs have translations for all languages.  By default, an
 
152
English message is shown in place of a nonexistent translation.  If you
 
153
understand other languages, you can set up a priority list of languages.
 
154
This is done through a different environment variable, called
 
155
@code{LANGUAGE}.  GNU @code{gettext} gives preference to @code{LANGUAGE}
 
156
over @code{LANG} for the purpose of message handling, but you still
 
157
need to have @code{LANG} set to the primary language; this is required
 
158
by other parts of the system libraries.
 
159
For example, some Swedish users who would rather read translations in
 
160
German than English for when Swedish is not available, set @code{LANGUAGE}
 
161
to @samp{sv:de} while leaving @code{LANG} to @samp{sv_SE}.
 
162
 
 
163
Special advice for Norwegian users: The language code for Norwegian
 
164
bokm@ringaccent{a}l changed from @samp{no} to @samp{nb} recently (in 2003).
 
165
During the transition period, while some message catalogs for this language
 
166
are installed under @samp{nb} and some older ones under @samp{no}, it's
 
167
recommended for Norwegian users to set @code{LANGUAGE} to @samp{nb:no} so that
 
168
both newer and older translations are used.
 
169
 
 
170
In the @code{LANGUAGE} environment variable, but not in the @code{LANG}
 
171
environment variable, @samp{@var{ll}_@var{CC}} combinations can be
 
172
abbreviated as @samp{@var{ll}} to denote the language's main dialect.
 
173
For example, @samp{de} is equivalent to @samp{de_DE} (German as spoken in
 
174
Germany), and @samp{pt} to @samp{pt_PT} (Portuguese as spoken in Portugal)
 
175
in this context.
 
176
 
 
177
@c An operating system might already offer message localization for many of
 
178
@c its programs, while other programs have been
 
179
@c installed locally with the full capabilities of GNU @code{gettext}.
 
180
@c Just using @code{gettext} extended syntax for @code{LANG} would break
 
181
@c proper localization of already available operating system programs.
 
182
@c FIXME: The user doesn't care about design justifications. --bruno
 
183
 
 
184
@node Translating Teams
 
185
@section Translating Teams
 
186
 
 
187
For the Free Translation Project to be a success, we need interested
 
188
people who like their own language and write it well, and who are also
 
189
able to synergize with other translators speaking the same language.
 
190
Each translation team has its own mailing list.  The up-to-date list
 
191
of teams can be found at the Free Translation Project's homepage,
 
192
@file{http://www.iro.umontreal.ca/contrib/po/HTML/}, in the
 
193
"National teams" area.
 
194
 
 
195
If you'd like to volunteer to @emph{work} at translating messages, you
 
196
should become a member of the translating team for your own language.
 
197
The subscribing address is @emph{not} the same as the list itself, it
 
198
has @samp{-request} appended.  For example, speakers of Swedish can send
 
199
a message to @w{@file{sv-request@@li.org}}, having this message body:
 
200
 
 
201
@example
 
202
subscribe
 
203
@end example
 
204
 
 
205
Keep in mind that team members are expected to participate
 
206
@emph{actively} in translations, or at solving translational
 
207
difficulties, rather than merely lurking around.  If your team does not
 
208
exist yet and you want to start one, or if you are unsure about what to
 
209
do or how to get started, please write to
 
210
@w{@file{translation@@iro.umontreal.ca}} to reach the
 
211
coordinator for all translator teams.
 
212
 
 
213
The English team is special.  It works at improving and uniformizing
 
214
the terminology in use.  Proven linguistic skill are praised
 
215
more than programming skill, here.
 
216
 
 
217
@node Available Packages
 
218
@section Available Packages
 
219
 
 
220
Languages are not equally supported in all packages.  The following
 
221
matrix shows the current state of internationalization, as of
 
222
@value{STATUS}.  The matrix shows, in regard of each package, for which
 
223
languages PO files have been submitted to translation coordination,
 
224
with a translation percentage of at least 50%.
 
225
 
 
226
@include matrix.texi
 
227
 
 
228
Some counters in the preceding matrix are higher than the number of visible
 
229
blocks let us expect.  This is because a few extra PO files are used for
 
230
implementing regional variants of languages, or language dialects.
 
231
 
 
232
For a PO file in the matrix above to be effective, the package to which
 
233
it applies should also have been internationalized and distributed as
 
234
such by its maintainer.  There might be an observable lag between the
 
235
mere existence a PO file and its wide availability in a distribution.
 
236
 
 
237
If @value{STATUS} seems to be old, you may fetch a more recent copy
 
238
of this @file{ABOUT-NLS} file on most GNU archive sites.  The most
 
239
up-to-date matrix with full percentage details can be found at
 
240
@file{http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html}.
 
241
 
 
242
 
 
243
@node Using gettext in own code
 
244
@section Using @code{gettext} in new packages
 
245
 
 
246
If you are writing a freely available program and want to internationalize
 
247
it you are welcome to use GNU @file{gettext} in your package.  Of course
 
248
you have to respect the GNU Library General Public License which covers
 
249
the use of the GNU @file{gettext} library.  This means in particular that
 
250
even non-free programs can use @code{libintl} as a shared library, whereas
 
251
only free software can use @code{libintl} as a static library or use
 
252
modified versions of @code{libintl}.
 
253
 
 
254
Once the sources are changed appropriately and the setup can handle the
 
255
use of @code{gettext} the only thing missing are the translations.  The
 
256
Free Translation Project is also available for packages which are not
 
257
developed inside the GNU project.  Therefore the information given above
 
258
applies also for every other Free Software Project.  Contact
 
259
@w{@file{translation@@iro.umontreal.ca}} to make the @file{.pot} files
 
260
available to the translation teams.