Install gettext-0.18.1.1.tar.gz
[msysgit.git] / mingw / share / doc / gettext / gettext_12.html
blob0ea6cba7059ca921af98061f6ae3df3544c7bf29
1 <HTML>
2 <HEAD>
3 <!-- This HTML file has been created by texi2html 1.52b
4 from gettext.texi on 6 June 2010 -->
6 <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
7 <TITLE>GNU gettext utilities - 12 The Translator's View</TITLE>
8 </HEAD>
9 <BODY>
10 Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_11.html">previous</A>, <A HREF="gettext_13.html">next</A>, <A HREF="gettext_25.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
11 <P><HR><P>
14 <H1><A NAME="SEC198" HREF="gettext_toc.html#TOC198">12 The Translator's View</A></H1>
18 <H2><A NAME="SEC199" HREF="gettext_toc.html#TOC199">12.1 Introduction 0</A></H2>
20 <P>
21 <STRONG> NOTE: </STRONG> This documentation section is outdated and needs to be
22 revised.
24 </P>
25 <P>
26 Free software is going international! The Translation Project is a way
27 to get maintainers, translators and users all together, so free software
28 will gradually become able to speak many native languages.
30 </P>
31 <P>
32 The GNU <CODE>gettext</CODE> tool set contains <EM>everything</EM> maintainers
33 need for internationalizing their packages for messages. It also
34 contains quite useful tools for helping translators at localizing
35 messages to their native language, once a package has already been
36 internationalized.
38 </P>
39 <P>
40 To achieve the Translation Project, we need many interested
41 people who like their own language and write it well, and who are also
42 able to synergize with other translators speaking the same language.
43 If you'd like to volunteer to <EM>work</EM> at translating messages,
44 please send mail to your translating team.
46 </P>
47 <P>
48 Each team has its own mailing list, courtesy of Linux
49 International. You may reach your translating team at the address
50 <TT>&lsquo;<VAR>ll</VAR>@li.org&rsquo;</TT>, replacing <VAR>ll</VAR> by the two-letter ISO 639
51 code for your language. Language codes are <EM>not</EM> the same as
52 country codes given in ISO 3166. The following translating teams
53 exist:
55 </P>
57 <BLOCKQUOTE>
58 <P>
59 Chinese <CODE>zh</CODE>, Czech <CODE>cs</CODE>, Danish <CODE>da</CODE>, Dutch <CODE>nl</CODE>,
60 Esperanto <CODE>eo</CODE>, Finnish <CODE>fi</CODE>, French <CODE>fr</CODE>, Irish
61 <CODE>ga</CODE>, German <CODE>de</CODE>, Greek <CODE>el</CODE>, Italian <CODE>it</CODE>,
62 Japanese <CODE>ja</CODE>, Indonesian <CODE>in</CODE>, Norwegian <CODE>no</CODE>, Polish
63 <CODE>pl</CODE>, Portuguese <CODE>pt</CODE>, Russian <CODE>ru</CODE>, Spanish <CODE>es</CODE>,
64 Swedish <CODE>sv</CODE> and Turkish <CODE>tr</CODE>.
65 </BLOCKQUOTE>
67 <P>
68 For example, you may reach the Chinese translating team by writing to
69 <TT>&lsquo;zh@li.org&rsquo;</TT>. When you become a member of the translating team
70 for your own language, you may subscribe to its list. For example,
71 Swedish people can send a message to <TT>&lsquo;sv-request@li.org&rsquo;</TT>,
72 having this message body:
74 </P>
76 <PRE>
77 subscribe
78 </PRE>
80 <P>
81 Keep in mind that team members should be interested in <EM>working</EM>
82 at translations, or at solving translational difficulties, rather than
83 merely lurking around. If your team does not exist yet and you want to
84 start one, please write to <TT>&lsquo;coordinator@translationproject.org&rsquo;</TT>;
85 you will then reach the coordinator for all translator teams.
87 </P>
88 <P>
89 A handful of GNU packages have already been adapted and provided
90 with message translations for several languages. Translation
91 teams have begun to organize, using these packages as a starting
92 point. But there are many more packages and many languages for
93 which we have no volunteer translators. If you would like to
94 volunteer to work at translating messages, please send mail to
95 <TT>&lsquo;coordinator@translationproject.org&rsquo;</TT> indicating what language(s)
96 you can work on.
98 </P>
101 <H2><A NAME="SEC200" HREF="gettext_toc.html#TOC200">12.2 Introduction 1</A></H2>
104 <STRONG> NOTE: </STRONG> This documentation section is outdated and needs to be
105 revised.
107 </P>
109 This is now official, GNU is going international! Here is the
110 announcement submitted for the January 1995 GNU Bulletin:
112 </P>
114 <BLOCKQUOTE>
116 A handful of GNU packages have already been adapted and provided
117 with message translations for several languages. Translation
118 teams have begun to organize, using these packages as a starting
119 point. But there are many more packages and many languages
120 for which we have no volunteer translators. If you'd like to
121 volunteer to work at translating messages, please send mail to
122 <SAMP>&lsquo;coordinator@translationproject.org&rsquo;</SAMP> indicating what language(s)
123 you can work on.
124 </BLOCKQUOTE>
127 This document should answer many questions for those who are curious about
128 the process or would like to contribute. Please at least skim over it,
129 hoping to cut down a little of the high volume of e-mail generated by this
130 collective effort towards internationalization of free software.
132 </P>
134 Most free programming which is widely shared is done in English, and
135 currently, English is used as the main communicating language between
136 national communities collaborating to free software. This very document
137 is written in English. This will not change in the foreseeable future.
139 </P>
141 However, there is a strong appetite from national communities for
142 having more software able to write using national language and habits,
143 and there is an on-going effort to modify free software in such a way
144 that it becomes able to do so. The experiments driven so far raised
145 an enthusiastic response from pretesters, so we believe that
146 internationalization of free software is dedicated to succeed.
148 </P>
150 For suggestion clarifications, additions or corrections to this
151 document, please e-mail to <TT>&lsquo;coordinator@translationproject.org&rsquo;</TT>.
153 </P>
156 <H2><A NAME="SEC201" HREF="gettext_toc.html#TOC201">12.3 Discussions</A></H2>
159 <STRONG> NOTE: </STRONG> This documentation section is outdated and needs to be
160 revised.
162 </P>
164 Facing this internationalization effort, a few users expressed their
165 concerns. Some of these doubts are presented and discussed, here.
167 </P>
169 <UL>
170 <LI>Smaller groups
172 Some languages are not spoken by a very large number of people, so people
173 speaking them sometimes consider that there may not be all that much
174 demand such versions of free software packages. Moreover, many people
175 being <EM>into computers</EM>, in some countries, generally seem to prefer
176 English versions of their software.
178 On the other end, people might enjoy their own language a lot, and be
179 very motivated at providing to themselves the pleasure of having their
180 beloved free software speaking their mother tongue. They do themselves
181 a personal favor, and do not pay that much attention to the number of
182 people benefiting of their work.
184 <LI>Misinterpretation
186 Other users are shy to push forward their own language, seeing in this
187 some kind of misplaced propaganda. Someone thought there must be some
188 users of the language over the networks pestering other people with it.
190 But any spoken language is worth localization, because there are
191 people behind the language for whom the language is important and
192 dear to their hearts.
194 <LI>Odd translations
196 The biggest problem is to find the right translations so that
197 everybody can understand the messages. Translations are usually a
198 little odd. Some people get used to English, to the extent they may
199 find translations into their own language “rather pushy, obnoxious
200 and sometimes even hilarious.” As a French speaking man, I have
201 the experience of those instruction manuals for goods, so poorly
202 translated in French in Korea or Taiwan...
204 The fact is that we sometimes have to create a kind of national
205 computer culture, and this is not easy without the collaboration of
206 many people liking their mother tongue. This is why translations are
207 better achieved by people knowing and loving their own language, and
208 ready to work together at improving the results they obtain.
210 <LI>Dependencies over the GPL or LGPL
212 Some people wonder if using GNU <CODE>gettext</CODE> necessarily brings their
213 package under the protective wing of the GNU General Public License or
214 the GNU Library General Public License, when they do not want to make
215 their program free, or want other kinds of freedom. The simplest
216 answer is “normally not”.
218 The <CODE>gettext-runtime</CODE> part of GNU <CODE>gettext</CODE>, i.e. the
219 contents of <CODE>libintl</CODE>, is covered by the GNU Library General Public
220 License. The <CODE>gettext-tools</CODE> part of GNU <CODE>gettext</CODE>, i.e. the
221 rest of the GNU <CODE>gettext</CODE> package, is covered by the GNU General
222 Public License.
224 The mere marking of localizable strings in a package, or conditional
225 inclusion of a few lines for initialization, is not really including
226 GPL'ed or LGPL'ed code. However, since the localization routines in
227 <CODE>libintl</CODE> are under the LGPL, the LGPL needs to be considered.
228 It gives the right to distribute the complete unmodified source of
229 <CODE>libintl</CODE> even with non-free programs. It also gives the right
230 to use <CODE>libintl</CODE> as a shared library, even for non-free programs.
231 But it gives the right to use <CODE>libintl</CODE> as a static library or
232 to incorporate <CODE>libintl</CODE> into another library only to free
233 software.
235 </UL>
239 <H2><A NAME="SEC202" HREF="gettext_toc.html#TOC202">12.4 Organization</A></H2>
242 <STRONG> NOTE: </STRONG> This documentation section is outdated and needs to be
243 revised.
245 </P>
247 On a larger scale, the true solution would be to organize some kind of
248 fairly precise set up in which volunteers could participate. I gave
249 some thought to this idea lately, and realize there will be some
250 touchy points. I thought of writing to Richard Stallman to launch
251 such a project, but feel it might be good to shake out the ideas
252 between ourselves first. Most probably that Linux International has
253 some experience in the field already, or would like to orchestrate
254 the volunteer work, maybe. Food for thought, in any case!
256 </P>
258 I guess we have to setup something early, somehow, that will help
259 many possible contributors of the same language to interlock and avoid
260 work duplication, and further be put in contact for solving together
261 problems particular to their tongue (in most languages, there are many
262 difficulties peculiar to translating technical English). My Swedish
263 contributor acknowledged these difficulties, and I'm well aware of
264 them for French.
266 </P>
268 This is surely not a technical issue, but we should manage so the
269 effort of locale contributors be maximally useful, despite the national
270 team layer interface between contributors and maintainers.
272 </P>
274 The Translation Project needs some setup for coordinating language
275 coordinators. Localizing evolving programs will surely
276 become a permanent and continuous activity in the free software community,
277 once well started.
278 The setup should be minimally completed and tested before GNU
279 <CODE>gettext</CODE> becomes an official reality. The e-mail address
280 <TT>&lsquo;coordinator@translationproject.org&rsquo;</TT> has been set up for receiving
281 offers from volunteers and general e-mail on these topics. This address
282 reaches the Translation Project coordinator.
284 </P>
288 <H3><A NAME="SEC203" HREF="gettext_toc.html#TOC203">12.4.1 Central Coordination</A></H3>
291 I also think GNU will need sooner than it thinks, that someone set up
292 a way to organize and coordinate these groups. Some kind of group
293 of groups. My opinion is that it would be good that GNU delegates
294 this task to a small group of collaborating volunteers, shortly.
295 Perhaps in <TT>&lsquo;gnu.announce&rsquo;</TT> a list of this national committee's
296 can be published.
298 </P>
300 My role as coordinator would simply be to refer to Ulrich any German
301 speaking volunteer interested to localization of free software packages, and
302 maybe helping national groups to initially organize, while maintaining
303 national registries for until national groups are ready to take over.
304 In fact, the coordinator should ease volunteers to get in contact with
305 one another for creating national teams, which should then select
306 one coordinator per language, or country (regionalized language).
307 If well done, the coordination should be useful without being an
308 overwhelming task, the time to put delegations in place.
310 </P>
313 <H3><A NAME="SEC204" HREF="gettext_toc.html#TOC204">12.4.2 National Teams</A></H3>
316 I suggest we look for volunteer coordinators/editors for individual
317 languages. These people will scan contributions of translation files
318 for various programs, for their own languages, and will ensure high
319 and uniform standards of diction.
321 </P>
323 From my current experience with other people in these days, those who
324 provide localizations are very enthusiastic about the process, and are
325 more interested in the localization process than in the program they
326 localize, and want to do many programs, not just one. This seems
327 to confirm that having a coordinator/editor for each language is a
328 good idea.
330 </P>
332 We need to choose someone who is good at writing clear and concise
333 prose in the language in question. That is hard--we can't check
334 it ourselves. So we need to ask a few people to judge each others'
335 writing and select the one who is best.
337 </P>
339 I announce my prerelease to a few dozen people, and you would not
340 believe all the discussions it generated already. I shudder to think
341 what will happen when this will be launched, for true, officially,
342 world wide. Who am I to arbitrate between two Czekolsovak users
343 contradicting each other, for example?
345 </P>
347 I assume that your German is not much better than my French so that
348 I would not be able to judge about these formulations. What I would
349 suggest is that for each language there is a group for people who
350 maintain the PO files and judge about changes. I suspect there will
351 be cultural differences between how such groups of people will behave.
352 Some will have relaxed ways, reach consensus easily, and have anyone
353 of the group relate to the maintainers, while others will fight to
354 death, organize heavy administrations up to national standards, and
355 use strict channels.
357 </P>
359 The German team is putting out a good example. Right now, they are
360 maybe half a dozen people revising translations of each other and
361 discussing the linguistic issues. I do not even have all the names.
362 Ulrich Drepper is taking care of coordinating the German team.
363 He subscribed to all my pretest lists, so I do not even have to warn
364 him specifically of incoming releases.
366 </P>
368 I'm sure, that is a good idea to get teams for each language working
369 on translations. That will make the translations better and more
370 consistent.
372 </P>
376 <H4><A NAME="SEC205" HREF="gettext_toc.html#TOC205">12.4.2.1 Sub-Cultures</A></H4>
379 Taking French for example, there are a few sub-cultures around computers
380 which developed diverging vocabularies. Picking volunteers here and
381 there without addressing this problem in an organized way, soon in the
382 project, might produce a distasteful mix of internationalized programs,
383 and possibly trigger endless quarrels among those who really care.
385 </P>
387 Keeping some kind of unity in the way French localization of
388 internationalized programs is achieved is a difficult (and delicate) job.
389 Knowing the latin character of French people (:-), if we take this
390 the wrong way, we could end up nowhere, or spoil a lot of energies.
391 Maybe we should begin to address this problem seriously <EM>before</EM>
392 GNU <CODE>gettext</CODE> become officially published. And I suspect that this
393 means soon!
395 </P>
398 <H4><A NAME="SEC206" HREF="gettext_toc.html#TOC206">12.4.2.2 Organizational Ideas</A></H4>
401 I expect the next big changes after the official release. Please note
402 that I use the German translation of the short GPL message. We need
403 to set a few good examples before the localization goes out for true
404 in the free software community. Here are a few points to discuss:
406 </P>
408 <UL>
409 <LI>
411 Each group should have one FTP server (at least one master).
413 <LI>
415 The files on the server should reflect the latest version (of
416 course!) and it should also contain a RCS directory with the
417 corresponding archives (I don't have this now).
419 <LI>
421 There should also be a ChangeLog file (this is more useful than the
422 RCS archive but can be generated automatically from the later by
423 Emacs).
425 <LI>
427 A <EM>core group</EM> should judge about questionable changes (for now
428 this group consists solely by me but I ask some others occasionally;
429 this also seems to work).
431 </UL>
435 <H3><A NAME="SEC207" HREF="gettext_toc.html#TOC207">12.4.3 Mailing Lists</A></H3>
438 If we get any inquiries about GNU <CODE>gettext</CODE>, send them on to:
440 </P>
442 <PRE>
443 <TT>&lsquo;coordinator@translationproject.org&rsquo;</TT>
444 </PRE>
447 The <TT>&lsquo;*-pretest&rsquo;</TT> lists are quite useful to me, maybe the idea could
448 be generalized to many GNU, and non-GNU packages. But each maintainer
449 his/her way!
451 </P>
453 Fran&ccedil;ois, we have a mechanism in place here at
454 <TT>&lsquo;gnu.ai.mit.edu&rsquo;</TT> to track teams, support mailing lists for
455 them and log members. We have a slight preference that you use it.
456 If this is OK with you, I can get you clued in.
458 </P>
460 Things are changing! A few years ago, when Daniel Fekete and I
461 asked for a mailing list for GNU localization, nested at the FSF, we
462 were politely invited to organize it anywhere else, and so did we.
463 For communicating with my pretesters, I later made a handful of
464 mailing lists located at iro.umontreal.ca and administrated by
465 <CODE>majordomo</CODE>. These lists have been <EM>very</EM> dependable
466 so far...
468 </P>
470 I suspect that the German team will organize itself a mailing list
471 located in Germany, and so forth for other countries. But before they
472 organize for true, it could surely be useful to offer mailing lists
473 located at the FSF to each national team. So yes, please explain me
474 how I should proceed to create and handle them.
476 </P>
478 We should create temporary mailing lists, one per country, to help
479 people organize. Temporary, because once regrouped and structured, it
480 would be fair the volunteers from country bring back <EM>their</EM> list
481 in there and manage it as they want. My feeling is that, in the long
482 run, each team should run its own list, from within their country.
483 There also should be some central list to which all teams could
484 subscribe as they see fit, as long as each team is represented in it.
486 </P>
489 <H2><A NAME="SEC208" HREF="gettext_toc.html#TOC208">12.5 Information Flow</A></H2>
492 <STRONG> NOTE: </STRONG> This documentation section is outdated and needs to be
493 revised.
495 </P>
497 There will surely be some discussion about this messages after the
498 packages are finally released. If people now send you some proposals
499 for better messages, how do you proceed? Jim, please note that
500 right now, as I put forward nearly a dozen of localizable programs, I
501 receive both the translations and the coordination concerns about them.
503 </P>
505 If I put one of my things to pretest, Ulrich receives the announcement
506 and passes it on to the German team, who make last minute revisions.
507 Then he submits the translation files to me <EM>as the maintainer</EM>.
508 For free packages I do not maintain, I would not even hear about it.
509 This scheme could be made to work for the whole Translation Project,
510 I think. For security reasons, maybe Ulrich (national coordinators,
511 in fact) should update central registry kept at the Translation Project
512 (Jim, me, or Len's recruits) once in a while.
514 </P>
516 In December/January, I was aggressively ready to internationalize
517 all of GNU, giving myself the duty of one small GNU package per week
518 or so, taking many weeks or months for bigger packages. But it does
519 not work this way. I first did all the things I'm responsible for.
520 I've nothing against some missionary work on other maintainers, but
521 I'm also loosing a lot of energy over it--same debates over again.
523 </P>
525 And when the first localized packages are released we'll get a lot of
526 responses about ugly translations :-). Surely, and we need to have
527 beforehand a fairly good idea about how to handle the information
528 flow between the national teams and the package maintainers.
530 </P>
532 Please start saving somewhere a quick history of each PO file. I know
533 for sure that the file format will change, allowing for comments.
534 It would be nice that each file has a kind of log, and references for
535 those who want to submit comments or gripes, or otherwise contribute.
536 I sent a proposal for a fast and flexible format, but it is not
537 receiving acceptance yet by the GNU deciders. I'll tell you when I
538 have more information about this.
540 </P>
543 <H2><A NAME="SEC209" HREF="gettext_toc.html#TOC209">12.6 Translating plural forms</A></H2>
546 <A NAME="IDX1111"></A>
547 Suppose you are translating a PO file, and it contains an entry like this:
549 </P>
551 <PRE>
552 #, c-format
553 msgid "One file removed"
554 msgid_plural "%d files removed"
555 msgstr[0] ""
556 msgstr[1] ""
557 </PRE>
560 What does this mean? How do you fill it in?
562 </P>
564 Such an entry denotes a message with plural forms, that is, a message where
565 the text depends on a cardinal number. The general form of the message,
566 in English, is the <CODE>msgid_plural</CODE> line. The <CODE>msgid</CODE> line is the
567 English singular form, that is, the form for when the number is equal to 1.
568 More details about plural forms are explained in section <A HREF="gettext_11.html#SEC188">11.2.6 Additional functions for plural forms</A>.
570 </P>
572 The first thing you need to look at is the <CODE>Plural-Forms</CODE> line in the
573 header entry of the PO file. It contains the number of plural forms and a
574 formula. If the PO file does not yet have such a line, you have to add it.
575 It only depends on the language into which you are translating. You can
576 get this info by using the <CODE>msginit</CODE> command (see section <A HREF="gettext_6.html#SEC37">6 Creating a New PO File</A>) --
577 it contains a database of known plural formulas -- or by asking other
578 members of your translation team.
580 </P>
582 Suppose the line looks as follows:
584 </P>
586 <PRE>
587 "Plural-Forms: nplurals=3; plural=n%10==1 &#38;&#38; n%100!=11 ? 0 : n%10&#62;=2 &#38;&#38; n"
588 "%10&#60;=4 &#38;&#38; (n%100&#60;10 || n%100&#62;=20) ? 1 : 2;\n"
589 </PRE>
592 It's logically one line; recall that the PO file formatting is allowed to
593 break long lines so that each physical line fits in 80 monospaced columns.
595 </P>
597 The value of <CODE>nplurals</CODE> here tells you that there are three plural
598 forms. The first thing you need to do is to ensure that the entry contains
599 an <CODE>msgstr</CODE> line for each of the forms:
601 </P>
603 <PRE>
604 #, c-format
605 msgid "One file removed"
606 msgid_plural "%d files removed"
607 msgstr[0] ""
608 msgstr[1] ""
609 msgstr[2] ""
610 </PRE>
613 Then translate the <CODE>msgid_plural</CODE> line and fill it in into each
614 <CODE>msgstr</CODE> line:
616 </P>
618 <PRE>
619 #, c-format
620 msgid "One file removed"
621 msgid_plural "%d files removed"
622 msgstr[0] "%d slika uklonjenih"
623 msgstr[1] "%d slika uklonjenih"
624 msgstr[2] "%d slika uklonjenih"
625 </PRE>
628 Now you can refine the translation so that it matches the plural form.
629 According to the formula above, <CODE>msgstr[0]</CODE> is used when the number
630 ends in 1 but does not end in 11; <CODE>msgstr[1]</CODE> is used when the number
631 ends in 2, 3, 4, but not in 12, 13, 14; and <CODE>msgstr[2]</CODE> is used in
632 all other cases. With this knowledge, you can refine the translations:
634 </P>
636 <PRE>
637 #, c-format
638 msgid "One file removed"
639 msgid_plural "%d files removed"
640 msgstr[0] "%d slika je uklonjena"
641 msgstr[1] "%d datoteke uklonjenih"
642 msgstr[2] "%d slika uklonjenih"
643 </PRE>
646 You noticed that in the English singular form (<CODE>msgid</CODE>) the number
647 placeholder could be omitted and replaced by the numeral word “one”.
648 Can you do this in your translation as well?
650 </P>
652 <PRE>
653 msgstr[0] "jednom datotekom je uklonjen"
654 </PRE>
657 Well, it depends on whether <CODE>msgstr[0]</CODE> applies only to the number 1,
658 or to other numbers as well. If, according to the plural formula,
659 <CODE>msgstr[0]</CODE> applies only to <CODE>n == 1</CODE>, then you can use the
660 specialized translation without the number placeholder. In our case,
661 however, <CODE>msgstr[0]</CODE> also applies to the numbers 21, 31, 41, etc.,
662 and therefore you cannot omit the placeholder.
664 </P>
667 <H2><A NAME="SEC210" HREF="gettext_toc.html#TOC210">12.7 Prioritizing messages: How to determine which messages to translate first</A></H2>
670 A translator sometimes has only a limited amount of time per week to
671 spend on a package, and some packages have quite large message catalogs
672 (over 1000 messages). Therefore she wishes to translate the messages
673 first that are the most visible to the user, or that occur most frequently.
674 This section describes how to determine these "most urgent" messages.
675 It also applies to determine the "next most urgent" messages after the
676 message catalog has already been partially translated.
678 </P>
680 In a first step, she uses the programs like a user would do. While she
681 does this, the GNU <CODE>gettext</CODE> library logs into a file the not yet
682 translated messages for which a translation was requested from the program.
684 </P>
686 In a second step, she uses the PO mode to translate precisely this set
687 of messages.
689 </P>
691 <A NAME="IDX1112"></A>
692 Here a more details. The GNU <CODE>libintl</CODE> library (but not the
693 corresponding functions in GNU <CODE>libc</CODE>) supports an environment variable
694 <CODE>GETTEXT_LOG_UNTRANSLATED</CODE>. The GNU <CODE>libintl</CODE> library will
695 log into this file the messages for which <CODE>gettext()</CODE> and related
696 functions couldn't find the translation. If the file doesn't exist, it
697 will be created as needed. On systems with GNU <CODE>libc</CODE> a shared library
698 <SAMP>&lsquo;preloadable_libintl.so&rsquo;</SAMP> is provided that can be used with the ELF
699 <SAMP>&lsquo;LD_PRELOAD&rsquo;</SAMP> mechanism.
701 </P>
703 So, in the first step, the translator uses these commands on systems with
704 GNU <CODE>libc</CODE>:
706 </P>
708 <PRE>
709 $ LD_PRELOAD=/usr/local/lib/preloadable_libintl.so
710 $ export LD_PRELOAD
711 $ GETTEXT_LOG_UNTRANSLATED=$HOME/gettextlogused
712 $ export GETTEXT_LOG_UNTRANSLATED
713 </PRE>
716 and these commands on other systems:
718 </P>
720 <PRE>
721 $ GETTEXT_LOG_UNTRANSLATED=$HOME/gettextlogused
722 $ export GETTEXT_LOG_UNTRANSLATED
723 </PRE>
726 Then she uses and peruses the programs. (It is a good and recommended
727 practice to use the programs for which you provide translations: it
728 gives you the needed context.) When done, she removes the environment
729 variables:
731 </P>
733 <PRE>
734 $ unset LD_PRELOAD
735 $ unset GETTEXT_LOG_UNTRANSLATED
736 </PRE>
739 The second step starts with removing duplicates:
741 </P>
743 <PRE>
744 $ msguniq $HOME/gettextlogused &#62; missing.po
745 </PRE>
748 The result is a PO file, but needs some preprocessing before a PO file editor
749 can be used with it. First, it is a multi-domain PO file, containing
750 messages from many translation domains. Second, it lacks all translator
751 comments and source references. Here is how to get a list of the affected
752 translation domains:
754 </P>
756 <PRE>
757 $ sed -n -e 's,^domain "\(.*\)"$,\1,p' &#60; missing.po | sort | uniq
758 </PRE>
761 Then the translator can handle the domains one by one. For simplicity,
762 let's use environment variables to denote the language, domain and source
763 package.
765 </P>
767 <PRE>
768 $ lang=nl # your language
769 $ domain=coreutils # the name of the domain to be handled
770 $ package=/usr/src/gnu/coreutils-4.5.4 # the package where it comes from
771 </PRE>
774 She takes the latest copy of <TT>&lsquo;$lang.po&rsquo;</TT> from the Translation Project,
775 or from the package (in most cases, <TT>&lsquo;$package/po/$lang.po&rsquo;</TT>), or
776 creates a fresh one if she's the first translator (see section <A HREF="gettext_6.html#SEC37">6 Creating a New PO File</A>).
777 She then uses the following commands to mark the not urgent messages as
778 "obsolete". (This doesn't mean that these messages - translated and
779 untranslated ones - will go away. It simply means that the PO file editor
780 will ignore them in the following editing session.)
782 </P>
784 <PRE>
785 $ msggrep --domain=$domain missing.po | grep -v '^domain' \
786 &#62; $domain-missing.po
787 $ msgattrib --set-obsolete --ignore-file $domain-missing.po $domain.$lang.po \
788 &#62; $domain.$lang-urgent.po
789 </PRE>
792 The she translates <TT>&lsquo;$domain.$lang-urgent.po&rsquo;</TT> by use of a PO file editor
793 (see section <A HREF="gettext_8.html#SEC55">8 Editing PO Files</A>).
794 (FIXME: I don't know whether <CODE>KBabel</CODE> and <CODE>gtranslator</CODE> also
795 preserve obsolete messages, as they should.)
796 Finally she restores the not urgent messages (with their earlier
797 translations, for those which were already translated) through this command:
799 </P>
801 <PRE>
802 $ msgmerge --no-fuzzy-matching $domain.$lang-urgent.po $package/po/$domain.pot \
803 &#62; $domain.$lang.po
804 </PRE>
807 Then she can submit <TT>&lsquo;$domain.$lang.po&rsquo;</TT> and proceed to the next domain.
809 </P>
810 <P><HR><P>
811 Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_11.html">previous</A>, <A HREF="gettext_13.html">next</A>, <A HREF="gettext_25.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
812 </BODY>
813 </HTML>