home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / gettext.info-4 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  47.8 KB  |  1,077 lines

  1. This is Info file gettext.info, produced by Makeinfo-1.64 from the
  2. input file /ade-src/fsf/gettext/doc/gettext.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Gettext Utilities: (gettext).        GNU gettext utilities.
  6. * gettextize: (gettext)gettextize Invocation.    Prepare a package for gettext.
  7. * msgfmt: (gettext)msgfmt Invocation.        Make MO files out of PO files.
  8. * msgmerge: (gettext)msgmerge Invocation.    Update two PO files into one.
  9. * xgettext: (gettext)xgettext Invocation.    Extract strings into a PO file.
  10. END-INFO-DIR-ENTRY
  11.  
  12.    This file provides documentation for GNU `gettext' utilities.
  13.  
  14.    Copyright (C) 1995 Free Software Foundation, Inc.
  15.  
  16.    Permission is granted to make and distribute verbatim copies of this
  17. manual provided the copyright notice and this permission notice are
  18. preserved on all copies.
  19.  
  20.    Permission is granted to copy and distribute modified versions of
  21. this manual under the conditions for verbatim copying, provided that
  22. the entire resulting derived work is distributed under the terms of a
  23. permission notice identical to this one.
  24.  
  25.    Permission is granted to copy and distribute translations of this
  26. manual into another language, under the above conditions for modified
  27. versions, except that this permission notice may be stated in a
  28. translation approved by the Foundation.
  29.  
  30. 
  31. File: gettext.info,  Node: Comparison,  Next: Using libintl.a,  Prev: gettext,  Up: Programmers
  32.  
  33. Comparing the Two Interfaces
  34. ============================
  35.  
  36.    The following discussion is perhaps a little bit colored.  As said
  37. above we implemented GNU `gettext' following the Uniforum proposal and
  38. this surely has its reasons.  But it should show how we came to this
  39. decision.
  40.  
  41.    First we take a look at the developing process.  When we write an
  42. application using NLS provided by `gettext' we proceed as always.  Only
  43. when we come to a string which might be seen by the users and thus has
  44. to be translated we use `gettext("...")' instead of `"..."'.  At the
  45. beginning of each source file (or in a central header file) we define
  46.  
  47.      #define gettext(String) (String)
  48.  
  49.    Even this definition can be avoided when the system supports the
  50. `gettext' function in its C library.  When we compile this code the
  51. result is the same as if no NLS code is used.  When  you take a look at
  52. the GNU `gettext' code you will see that we use `_("...")' instead of
  53. `gettext("...")'.  This reduces the number of additional characters per
  54. translatable string to *3* (in words: three).
  55.  
  56.    When now a production version of the program is needed we simply
  57. replace the definition
  58.  
  59.      #define _(String) (String)
  60.  
  61. by
  62.  
  63.      #include <libintl.h>
  64.      #define _(String) gettext (String)
  65.  
  66. Additionally we run the program `xgettext' on all source code file
  67. which contain translatable strings and that's it: we have a running
  68. program which does not depend on translations to be available, but which
  69. can use any that becomes available.
  70.  
  71.    The same procedure can be done for the `gettext_noop' invocations
  72. (*note Special cases::.).  First you can define `gettext_noop' to a
  73. no-op macro and later use the definition from `libintl.h'.  Because
  74. this name is not used in Suns implementation of `libintl.h', you should
  75. consider the following code for your project:
  76.  
  77.      #ifdef gettext_noop
  78.      # define N_(String) gettext_noop (String)
  79.      #else
  80.      # define N_(String) (String)
  81.      #endif
  82.  
  83.    `N_' is a short form similar to `_'.  The `Makefile' in the `po/'
  84. directory of GNU gettext knows by default both of the mentioned short
  85. forms so you are invited to follow this proposal for your own ease.
  86.  
  87.    Now to `catgets'.  The main problem is the work for the programmer.
  88. Every time he comes to a translatable string he has to define a number
  89. (or a symbolic constant) which has also be defined in the message
  90. catalog file.  He also has to take care for duplicate entries,
  91. duplicate message IDs etc.  If he wants to have the same quality in the
  92. message catalog as the GNU `gettext' program provides he also has to
  93. put the descriptive comments for the strings and the location in all
  94. source code files in the message catalog.  This is nearly a Mission:
  95. Impossible.
  96.  
  97.    But there are also some points people might call advantages speaking
  98. for `catgets'.  If you have a single word in a string and this string
  99. is used in different contexts it is likely that in one or the other
  100. language the word has different translations.  Example:
  101.  
  102.      printf ("%s: %d", gettext ("number"), number_of_errors)
  103.      
  104.      printf ("you should see %d %s", number_count,
  105.              number_count == 1 ? gettext ("number") : gettext ("numbers"))
  106.  
  107.    Here we have to translate two times the string `"number"'.  Even if
  108. you do not speak a language beside English it might be possible to
  109. recognize that the two words have a different meaning.  In German the
  110. first appearance has to be translated to `"Anzahl"' and the second to
  111. `"Zahl"'.
  112.  
  113.    Now you can say that this example is really esoteric.  And you are
  114. right!  This is exactly how we felt about this problem and decide that
  115. it does not weight that much.  The solution for the above problem could
  116. be very easy:
  117.  
  118.      printf ("%s %d", gettext ("number:"), number_of_errors)
  119.      
  120.      printf (number_count == 1 ? gettext ("you should see %d number")
  121.                                : gettext ("you should see %d numbers"),
  122.              number_count)
  123.  
  124.    We believe that we can solve all conflicts with this method.  If it
  125. is difficult one can also consider changing one of the conflicting
  126. string a little bit.  But it is not impossible to overcome.
  127.  
  128.    Translator note: It is perhaps appropriate here to tell those English
  129. speaking programmers that the plural form of a noun cannot be formed by
  130. appending a single `s'.  Most other languages use different methods.
  131. Even the above form is not general enough to cope with all languages.
  132. Rafal Maszkowski <rzm@mat.uni.torun.pl> reports:
  133.  
  134.      In Polish we use e.g. plik (file) this way:
  135.           1 plik
  136.           2,3,4 pliki
  137.           5-21 pliko'w
  138.           22-24 pliki
  139.           25-31 pliko'w
  140.      and so on (o' means 8859-2 oacute which should be rather okreska,
  141.      similar to aogonek).
  142.  
  143.    A workable approach might be to consider methods like the one used
  144. for `LC_TIME' in the POSIX.2 standard.  The value of the `alt_digits'
  145. field can be up to 100 strings which represent the numbers 1 to 100.
  146. Using this in a situation of an internationalized program means that an
  147. array of translatable strings should be indexed by the number which
  148. should represent.  A small example:
  149.  
  150.      void
  151.      print_month_info (int month)
  152.      {
  153.        const char *month_pos[12] =
  154.        { N_("first"), N_("second"), N_("third"),    N_("fourth"),
  155.          N_("fifth"), N_("sixth"),  N_("seventh"),  N_("eighth"),
  156.          N_("ninth"), N_("tenth"),  N_("eleventh"), N_("twelfth") };
  157.        printf (_("%s is the %s month\n"), nl_langinfo (MON_1 + month),
  158.                _(month_pos[month]));
  159.      }
  160.  
  161. It should be obvious that this method is only reasonable for small
  162. ranges of numbers.
  163.  
  164. 
  165. File: gettext.info,  Node: Using libintl.a,  Next: gettext grok,  Prev: Comparison,  Up: Programmers
  166.  
  167. Using libintl.a in own programs
  168. ===============================
  169.  
  170.    Starting with version 0.9.4 the library `libintl.h' should be
  171. self-contained.  I.e., you can use it in your own programs without
  172. providing additional functions.  The `Makefile' will put the header and
  173. the library in directories selected using the `$(prefix)'.
  174.  
  175.    One exception of the above is found on HP-UX systems.  Here the C
  176. library does not contain the `alloca' function (and the HP compiler does
  177. not generate it inlined).  But it is not intended to rewrite the whole
  178. library just because of this dumb system.  Instead include the `alloca'
  179. function in all package you use the `libintl.a' in.
  180.  
  181. 
  182. File: gettext.info,  Node: gettext grok,  Next: Temp Programmers,  Prev: Using libintl.a,  Up: Programmers
  183.  
  184. Being a `gettext' grok
  185. ======================
  186.  
  187.    To fully exploit the functionality of the GNU `gettext' library it
  188. is surely helpful to read the source code.  But for those who don't want
  189. to spend that much time in reading the (sometimes complicated) code here
  190. is a list comments:
  191.  
  192.    * Changing the language at runtime
  193.  
  194.      For interactive programs it might be useful to offer a selection
  195.      of the used language at runtime.  To understand how to do this one
  196.      need to know how the used language is determined while executing
  197.      the `gettext' function.  The method which is presented here only
  198.      works correctly with the GNU implementation of the `gettext'
  199.      functions.  It is not possible with underlying `catgets' functions
  200.      or `gettext' functions from the systems C library.  The exception
  201.      is of course the GNU C Library which uses the GNU gettext Library
  202.      for message handling.
  203.  
  204.      In the function `dcgettext' at every call the current setting of
  205.      the highest priority environment variable is determined and used.
  206.      Highest priority means here the following list with decreasing
  207.      priority:
  208.  
  209.        1. `LANGUAGE'
  210.  
  211.        2. `LC_ALL'
  212.  
  213.        3. `LC_xxx', according to selected locale
  214.  
  215.        4. `LANG'
  216.  
  217.      Afterwards the path is constructed using the found value and the
  218.      translation file is loaded if available.
  219.  
  220.      What is now when the value for, say, `LANGUAGE' changes.  According
  221.      to the process explained above the new value of this variable is
  222.      found as soon as the `dcgettext' function is called.  But this
  223.      also means the (perhaps) different message catalog file is loaded.
  224.      In other words: the used language is changed.
  225.  
  226.      But there is one little hook.  The code for gcc-2.7.0 and up
  227.      provides some optimization.  This optimization normally prevents
  228.      the calling of the `dcgettext' function as long as no new catalog
  229.      is loaded.  But if `dcgettext' is not called the program also
  230.      cannot find the `LANGUAGE' variable be changed (*note Optimized
  231.      gettext::.).  A solution for this is very easy.  Include the
  232.      following code in the language switching function.
  233.  
  234.             /* Change language.  */
  235.             setenv ("LANGUAGE", "fr", 1);
  236.           
  237.             /* Make change known.  */
  238.             {
  239.               extern int  _nl_msg_cat_cntr;
  240.               ++_nl_msg_cat_cntr;
  241.             }
  242.  
  243.      The variable `_nl_msg_cat_cntr' is defined in `loadmsgcat.c'.  The
  244.      programmer will find himself in need for a construct like this only
  245.      when developing programs which do run longer and provide the user
  246.      to select the language at runtime.  Non-interactive programs (like
  247.      all these little Unix tools) should never need this.
  248.  
  249. 
  250. File: gettext.info,  Node: Temp Programmers,  Prev: gettext grok,  Up: Programmers
  251.  
  252. Temporary Notes for the Programmers Chapter
  253. ===========================================
  254.  
  255. * Menu:
  256.  
  257. * Temp Implementations::        Temporary - Two Possible Implementations
  258. * Temp catgets::                Temporary - About `catgets'
  259. * Temp WSI::                    Temporary - Why a single implementation
  260. * Temp Notes::                  Temporary - Notes
  261.  
  262. 
  263. File: gettext.info,  Node: Temp Implementations,  Next: Temp catgets,  Prev: Temp Programmers,  Up: Temp Programmers
  264.  
  265. Temporary - Two Possible Implementations
  266. ----------------------------------------
  267.  
  268.    There are two competing methods for language independent messages:
  269. the X/Open `catgets' method, and the Uniforum `gettext' method.  The
  270. `catgets' method indexes messages by integers; the `gettext' method
  271. indexes them by their English translations.  The `catgets' method has
  272. been around longer and is supported by more vendors.  The `gettext'
  273. method is supported by Sun, and it has been heard that the COSE
  274. multi-vendor initiative is supporting it.  Neither method is a POSIX
  275. standard; the POSIX.1 committee had a lot of disagreement in this area.
  276.  
  277.    Neither one is in the POSIX standard.  There was much disagreement
  278. in the POSIX.1 committee about using the `gettext' routines vs.
  279. `catgets' (XPG).  In the end the committee couldn't agree on anything,
  280. so no messaging system was included as part of the standard.  I believe
  281. the informative annex of the standard includes the XPG3 messaging
  282. interfaces, "...as an example of a messaging system that has been
  283. implemented..."
  284.  
  285.    They were very careful not to say anywhere that you should use one
  286. set of interfaces over the other.  For more on this topic please see
  287. the Programming for Internationalization FAQ.
  288.  
  289. 
  290. File: gettext.info,  Node: Temp catgets,  Next: Temp WSI,  Prev: Temp Implementations,  Up: Temp Programmers
  291.  
  292. Temporary - About `catgets'
  293. ---------------------------
  294.  
  295.    There have been a few discussions of late on the use of `catgets' as
  296. a base.  I think it important to present both sides of the argument and
  297. hence am opting to play devil's advocate for a little bit.
  298.  
  299.    I'll not deny the fact that `catgets' could have been designed a lot
  300. better.  It currently has quite a number of limitations and these have
  301. already been pointed out.
  302.  
  303.    However there is a great deal to be said for consistency and
  304. standardization.  A common recurring problem when writing Unix software
  305. is the myriad portability problems across Unix platforms.  It seems as
  306. if every Unix vendor had a look at the operating system and found parts
  307. they could improve upon.  Undoubtedly, these modifications are probably
  308. innovative and solve real problems.  However, software developers have
  309. a hard time keeping up with all these changes across so many platforms.
  310.  
  311.    And this has prompted the Unix vendors to begin to standardize their
  312. systems.  Hence the impetus for Spec1170.  Every major Unix vendor has
  313. committed to supporting this standard and every Unix software developer
  314. waits with glee the day they can write software to this standard and
  315. simply recompile (without having to use autoconf) across different
  316. platforms.
  317.  
  318.    As I understand it, Spec1170 is roughly based upon version 4 of the
  319. X/Open Portability Guidelines (XPG4).  Because `catgets' and friends
  320. are defined in XPG4, I'm led to believe that `catgets' is a part of
  321. Spec1170 and hence will become a standardized component of all Unix
  322. systems.
  323.  
  324. 
  325. File: gettext.info,  Node: Temp WSI,  Next: Temp Notes,  Prev: Temp catgets,  Up: Temp Programmers
  326.  
  327. Temporary - Why a single implementation
  328. ---------------------------------------
  329.  
  330.    Now it seems kind of wasteful to me to have two different systems
  331. installed for accessing message catalogs.  If we do want to remedy
  332. `catgets' deficiencies why don't we try to expand `catgets' (in a
  333. compatible manner) rather than implement an entirely new system.
  334. Otherwise, we'll end up with two message catalog access systems
  335. installed with an operating system - one set of routines for GNU
  336. software, and another set of routines (catgets) for all other software.
  337. Bloated?
  338.  
  339.    Supposing another catalog access system is implemented.  Which do we
  340. recommend?  At least for Linux, we need to attract as many software
  341. developers as possible.  Hence we need to make it as easy for them to
  342. port their software as possible.  Which means supporting `catgets'.  We
  343. will be implementing the `glocale' code within our `libc', but does
  344. this mean we also have to incorporate another message catalog access
  345. scheme within our `libc' as well?  And what about people who are going
  346. to be using the `glocale' + non-`catgets' routines.  When they port
  347. their software to other platforms, they're now going to have to include
  348. the front-end (`glocale') code plus the back-end code (the non-`catgets'
  349. access routines) with their software instead of just including the
  350. `glocale' code with their software.
  351.  
  352.    Message catalog support is however only the tip of the iceberg.
  353. What about the data for the other locale categories.  They also have a
  354. number of deficiencies.  Are we going to abandon them as well and
  355. develop another duplicate set of routines (should `glocale' expand
  356. beyond message catalog support)?
  357.  
  358.    Like many parts of Unix that can be improved upon, we're stuck with
  359. balancing compatibility with the past with useful improvements and
  360. innovations for the future.
  361.  
  362. 
  363. File: gettext.info,  Node: Temp Notes,  Prev: Temp WSI,  Up: Temp Programmers
  364.  
  365. Temporary - Notes
  366. -----------------
  367.  
  368.    X/Open agreed very late on the standard form so that many
  369. implementations differ from the final form.  Both of my system (old
  370. Linux catgets and Ultrix-4) have a strange variation.
  371.  
  372.    OK.  After incorporating the last changes I have to spend some time
  373. on making the GNU/Linux libc gettext functions.  So in future Solaris is
  374. not the only system having gettext.
  375.  
  376. 
  377. File: gettext.info,  Node: Translators,  Next: Maintainers,  Prev: Programmers,  Up: Top
  378.  
  379. The Translator's View
  380. *********************
  381.  
  382. * Menu:
  383.  
  384. * Trans Intro 0::               Introduction 0
  385. * Trans Intro 1::               Introduction 1
  386. * Discussions::                 Discussions
  387. * Organization::                Organization
  388. * Information Flow::            Information Flow
  389.  
  390. 
  391. File: gettext.info,  Node: Trans Intro 0,  Next: Trans Intro 1,  Prev: Translators,  Up: Translators
  392.  
  393. Introduction 0
  394. ==============
  395.  
  396.    GNU is going international!  The GNU Translation Project is a way to
  397. get maintainers, translators and users all together, so GNU will
  398. gradually become able to speak many native languages.
  399.  
  400.    The GNU `gettext' tool set contains *everything* maintainers need
  401. for internationalizing their packages for messages.  It also contains
  402. quite useful tools for helping translators at localizing messages to
  403. their native language, once a package has already been
  404. internationalized.
  405.  
  406.    To achieve the GNU Translation Project, we need many interested
  407. people who like their own language and write it well, and who are also
  408. able to synergize with other translators speaking the same language.
  409. If you'd like to volunteer to *work* at translating messages, please
  410. send mail to your translating team.
  411.  
  412.    Each team has its own mailing list, courtesy of Linux International.
  413. You may reach your translating team at the address `LL@li.org',
  414. replacing LL by the two-letter ISO 639 code for your language.
  415. Language codes are *not* the same as country codes given in ISO 3166.
  416. The following translating teams exist:
  417.  
  418.      Chinese `zh', Czech `cs', Danish `da', Dutch `nl', Esperanto `eo',
  419.      Finnish `fi', French `fr', Irish `ga', German `de', Greek `el',
  420.      Italian `it', Japanese `ja', Indonesian `in', Norwegian `no',
  421.      Polish `pl', Portuguese `pt', Russian `ru', Spanish `es', Swedish
  422.      `sv' and Turkish `tr'.
  423.  
  424. For example, you may reach the Chinese translating team by writing to
  425. `zh@li.org'.  When you become a member of the translating team for your
  426. own language, you may subscribe to its list.  For example, Swedish
  427. people can send a message to `sv-request@li.org', having this message
  428. body:
  429.  
  430.      subscribe
  431.  
  432.    Keep in mind that team members should be interested in *working* at
  433. translations, or at solving translational difficulties, rather than
  434. merely lurking around.  If your team does not exist yet and you want to
  435. start one, please write to `gnu-translation@prep.ai.mit.edu'; you will
  436. then reach the GNU coordinator for all translator teams.
  437.  
  438.    A handful of GNU packages have already been adapted and provided
  439. with message translations for several languages.  Translation teams
  440. have begun to organize, using these packages as a starting point.  But
  441. there are many more packages and many languages for which we have no
  442. volunteer translators.  If you would like to volunteer to work at
  443. translating messages, please send mail to
  444. `gnu-translation@prep.ai.mit.edu' indicating what language(s) you can
  445. work on.
  446.  
  447. 
  448. File: gettext.info,  Node: Trans Intro 1,  Next: Discussions,  Prev: Trans Intro 0,  Up: Translators
  449.  
  450. Introduction 1
  451. ==============
  452.  
  453.    This is now official, GNU is going international!  Here is the
  454. announcement submitted for the January 1995 GNU Bulletin:
  455.  
  456.      A handful of GNU packages have already been adapted and provided
  457.      with message translations for several languages.  Translation
  458.      teams have begun to organize, using these packages as a starting
  459.      point.  But there are many more packages and many languages for
  460.      which we have no volunteer translators.  If you'd like to
  461.      volunteer to work at translating messages, please send mail to
  462.      `gnu-translation@prep.ai.mit.edu' indicating what language(s) you
  463.      can work on.
  464.  
  465.    This document should answer many questions for those who are curious
  466. about the process or would like to contribute.  Please at least skim
  467. over it, hoping to cut down a little of the high volume of e-mail
  468. generated by this collective effort towards GNU internationalization.
  469.  
  470.    GNU programming is done in English, and currently, English is used
  471. as the main communicating language between national communities
  472. collaborating to the GNU project.  This very document is written in
  473. English.  This will not change in the foreseeable future.
  474.  
  475.    However, there is a strong appetite from national communities for
  476. having more software able to write using national language and habits,
  477. and there is an on-going effort to modify GNU software in such a way
  478. that it becomes able to do so.  The experiments driven so far raised an
  479. enthusiastic response from pretesters, so we believe that GNU
  480. internationalization is dedicated to succeed.
  481.  
  482.    For suggestion clarifications, additions or corrections to this
  483. document, please e-mail to `gnu-translation@prep.ai.mit.edu'.
  484.  
  485. 
  486. File: gettext.info,  Node: Discussions,  Next: Organization,  Prev: Trans Intro 1,  Up: Translators
  487.  
  488. Discussions
  489. ===========
  490.  
  491.    Facing this internationalization effort, a few users expressed their
  492. concerns.  Some of these doubts are presented and discussed, here.
  493.  
  494.    * Smaller groups
  495.  
  496.      Some languages are not spoken by a very large number of people, so
  497.      people speaking them sometimes consider that there may not be all
  498.      that much demand such versions of GNU packages.  Moreover, many
  499.      people being *into computers*, in some countries, generally seem
  500.      to prefer English versions of their software.
  501.  
  502.      On the other end, people might enjoy their own language a lot, and
  503.      be very motivated at providing to themselves the pleasure of having
  504.      their beloved GNU software speaking their mother tongue.  They do
  505.      themselves a personal favor, and do not pay that much attention to
  506.      the number of people beneficiating of their work.
  507.  
  508.    * Misinterpretation
  509.  
  510.      Other users are shy to push forward their own language, seeing in
  511.      this some kind of misplaced propaganda.  Someone thought there
  512.      must be some users of the language over the networks pestering
  513.      other people with it.
  514.  
  515.      But any spoken language is worth localization, because there are
  516.      people behind the language for whom the language is important and
  517.      dear to their hearts.
  518.  
  519.    * Odd translations
  520.  
  521.      The biggest problem is to find the right translations so that
  522.      everybody can understand the messages.  Translations are usually a
  523.      little odd.  Some people get used to English, to the extent they
  524.      may find translations into their own language "rather pushy,
  525.      obnoxious and sometimes even hilarious."  As a French speaking
  526.      man, I have the experience of those instruction manuals for goods,
  527.      so poorly translated in French in Korea or Taiwan...
  528.  
  529.      The fact is that we sometimes have to create a kind of national
  530.      computer culture, and this is not easy without the collaboration of
  531.      many people liking their mother tongue.  This is why translations
  532.      are better achieved by people knowing and loving their own
  533.      language, and ready to work together at improving the results they
  534.      obtain.
  535.  
  536.    * Dependencies over the GPL
  537.  
  538.      Some people wonder if using GNU `gettext' necessarily brings their
  539.      package under the protective wing of the GNU General Public
  540.      License, when they do not want to make their program free, or want
  541.      other kinds of freedom.  The simplest answer is yes.
  542.  
  543.      The mere marking of localizable strings in a package, or
  544.      conditional inclusion of a few lines for initialization, is not
  545.      really including GPL'ed code.  However, the localization routines
  546.      themselves are under the GPL and would bring the remainder of the
  547.      package under the GPL if they were distributed with it.  So, I
  548.      presume that, for those for which this is a problem, it could be
  549.      circumvented by letting to the end installers the burden of
  550.      assembling a package prepared for localization, but not providing
  551.      the localization routines themselves.
  552.  
  553. 
  554. File: gettext.info,  Node: Organization,  Next: Information Flow,  Prev: Discussions,  Up: Translators
  555.  
  556. Organization
  557. ============
  558.  
  559.    On a larger scale, the true solution would be to organize some kind
  560. of fairly precise set up in which volunteers could participate.  I gave
  561. some thought to this idea lately, and realize there will be some touchy
  562. points.  I thought of writing to Richard Stallman to launch such a
  563. project, but feel it might be good to shake out the ideas between
  564. ourselves first.  Most probably that Linux International has some
  565. experience in the field already, or would like to orchestrate the
  566. volunteer work, maybe.  Food for thought, in any case!
  567.  
  568.    I guess we have to setup something early, somehow, that will help
  569. many possible contributors of the same language to interlock and avoid
  570. work duplication, and further be put in contact for solving together
  571. problems particular to their tongue (in most languages, there are many
  572. difficulties peculiar to translating technical English).  My Swedish
  573. contributor acknowledged these difficulties, and I'm well aware of them
  574. for French.
  575.  
  576.    This is surely not a technical issue, but we should manage so the
  577. effort of locale contributors be maximally useful, despite the national
  578. team layer interface between contributors and maintainers.
  579.  
  580.    GNU needs some setup for coordinating language coordinators.
  581. Localizing evolving GNU programs will surely become a permanent and
  582. continuous activity in GNU, once started.  The setup should be
  583. minimally completed and tested before GNU `gettext' becomes an official
  584. reality.  The e-mail address `gnu-translation@prep.ai.mit.edu' has been
  585. setup for receiving offers from volunteers and general e-mail on these
  586. topics.  This address reaches the GNU Translation Project coordinator.
  587.  
  588. * Menu:
  589.  
  590. * Central Coordination::        Central Coordination
  591. * National Teams::              National Teams
  592. * Mailing Lists::               Mailing Lists
  593.  
  594. 
  595. File: gettext.info,  Node: Central Coordination,  Next: National Teams,  Prev: Organization,  Up: Organization
  596.  
  597. Central Coordination
  598. --------------------
  599.  
  600.    I also think GNU will need sooner than it thinks, that someone setup
  601. a way to organize and coordinate these groups.  Some kind of group of
  602. groups.  My opinion is that it would be good that GNU delegate this
  603. task to a small group of collaborating volunteers, shortly.  Perhaps in
  604. `gnu.announce' a list of this national committee's can be published.
  605.  
  606.    My role as coordinator would simply be to refer to Ulrich any German
  607. speaking volunteer interested to localization of GNU programs, and
  608. maybe helping national groups to initially organize, while maintaining
  609. national registries for until national groups are ready to take over.
  610. In fact, the coordinator should ease volunteers to get in contact with
  611. one another for creating national teams, which should then select one
  612. coordinator per language, or country (regionalized language).  If well
  613. done, the coordination should be useful without being an overwhelming
  614. task, the time to put delegations in place.
  615.  
  616. 
  617. File: gettext.info,  Node: National Teams,  Next: Mailing Lists,  Prev: Central Coordination,  Up: Organization
  618.  
  619. National Teams
  620. --------------
  621.  
  622.    I suggest we look for volunteer coordinators/editors for individual
  623. languages.  These people will scan contributions of translation files
  624. for various programs, for their own languages, and will ensure high and
  625. uniform standards of diction.
  626.  
  627.    From my current experience with other people in these days, those who
  628. provide localizations are very enthusiastic about the process, and are
  629. more interested in the localization process than in the program they
  630. localize, and want to do many programs, not just one.  This seems to
  631. confirm that having a coordinator/editor for each language is a good
  632. idea.
  633.  
  634.    We need to choose someone who is good at writing clear and concise
  635. prose in the language in question.  That is hard--we can't check it
  636. ourselves.  So we need to ask a few people to judge each others'
  637. writing and select the one who is best.
  638.  
  639.    I announce my prerelease to a few dozen people, and you would not
  640. believe all the discussions it generated already.  I shudder to think
  641. what will happen when this will be launched, for true, officially,
  642. world wide.  Who am I to arbitrate between two Czekolsovak users
  643. contradicting each other, for example?
  644.  
  645.    I assume that your German is not much better than my French so that
  646. I would not be able to judge about these formulations.  What I would
  647. suggest is that for each language there is a group for people who
  648. maintain the PO files and judge about changes.  I suspect there will be
  649. cultural differences between how such groups of people will behave.
  650. Some will have relaxed ways, reach consensus easily, and have anyone of
  651. the group relate to the maintainers, while others will fight to death,
  652. organize heavy administrations up to national standards, and use strict
  653. channels.
  654.  
  655.    The German team is putting out a good example.  Right now, they are
  656. maybe half a dozen people revising translations of each other and
  657. discussing the linguistic issues.  I do not even have all the names.
  658. Ulrich Drepper is taking care of coordinating the German team.  He
  659. subscribed to all my pretest lists, so I do not even have to warn him
  660. specifically of incoming releases.
  661.  
  662.    I'm sure, that is a good idea to get teams for each language working
  663. on translations. That will make the translations better and more
  664. consistent.
  665.  
  666. * Menu:
  667.  
  668. * Sub-Cultures::                Sub-Cultures
  669. * Organizational Ideas::        Organizational Ideas
  670.  
  671. 
  672. File: gettext.info,  Node: Sub-Cultures,  Next: Organizational Ideas,  Prev: National Teams,  Up: National Teams
  673.  
  674. Sub-Cultures
  675. ............
  676.  
  677.    Taking French for example, there are a few sub-cultures around
  678. computers which developed diverging vocabularies.  Picking volunteers
  679. here and there without addressing this problem in an organized way,
  680. soon in the project, might produce a distasteful mix of GNU programs,
  681. and possibly trigger endless quarrels among those who really care.
  682.  
  683.    Keeping some kind of unity in the way French localization of GNU
  684. programs is achieved is a difficult (and delicate) job.  Knowing the
  685. latin character of French people (:-), if we take this the wrong way,
  686. we could end up nowhere, or spoil a lot of energies.  Maybe we should
  687. begin to address this problem seriously *before* GNU `gettext' become
  688. officially published.  And I suspect that this means soon!
  689.  
  690. 
  691. File: gettext.info,  Node: Organizational Ideas,  Prev: Sub-Cultures,  Up: National Teams
  692.  
  693. Organizational Ideas
  694. ....................
  695.  
  696.    I expect the next big changes after the official release.  Please
  697. note that I use the German translation of the short GPL message.  We
  698. need to set a few good examples before the localization goes out for
  699. true in GNU.  Here are a few points to discuss:
  700.  
  701.    * Each group should have one FTP server (at least one master).
  702.  
  703.    * The files on the server should reflect the latest version (of
  704.      course!) and it should also contain a RCS directory with the
  705.      corresponding archives (I don't have this now).
  706.  
  707.    * There should also be a ChangeLog file (this is more useful than the
  708.      RCS archive but can be generated automatically from the later by
  709.      Emacs).
  710.  
  711.    * A "core group" should judge about questionable changes (for now
  712.      this group consists solely by me but I ask some others
  713.      occasionally; this also seems to work).
  714.  
  715. 
  716. File: gettext.info,  Node: Mailing Lists,  Prev: National Teams,  Up: Organization
  717.  
  718. Mailing Lists
  719. -------------
  720.  
  721.    If we get any inquiries about GNU `gettext', send them on to:
  722.  
  723.      `gnu-translation@prep.ai.mit.edu'
  724.  
  725.    The `*-pretest' lists are quite useful to me, maybe the idea could
  726. be generalized to all GNU packages.  But each maintainer his/her way!
  727.  
  728.    Franc,ois, we have a mechanism in place here at `gnu.ai.mit.edu' to
  729. track teams, support mailing lists for them and log members.  We have a
  730. slight preference that you use it.  If this is OK with you, I can get
  731. you clued in.
  732.  
  733.    Things are changing!  A few years ago, when Daniel Fekete and I
  734. asked for a mailing list for GNU localization, nested at the FSF, we
  735. were politely invited to organize it anywhere else, and so did we.  For
  736. communicating with my pretesters, I later made a handful of mailing
  737. lists located at iro.umontreal.ca and administrated by `majordomo'.
  738. These lists have been *very* dependable so far...
  739.  
  740.    I suspect that the German team will organize itself a mailing list
  741. located in Germany, and so forth for other countries.  But before they
  742. organize for true, it could surely be useful to offer mailing lists
  743. located at the FSF to each national team.  So yes, please explain me
  744. how I should proceed to create and handle them.
  745.  
  746.    We should create temporary mailing lists, one per country, to help
  747. people organize.  Temporary, because once regrouped and structured, it
  748. would be fair the volunteers from country bring back *their* list in
  749. there and manage it as they want.  My feeling is that, in the long run,
  750. each team should run its own list, from within their country.  There
  751. also should be some central list to which all teams could subscribe as
  752. they see fit, as long as each team is represented in it.
  753.  
  754. 
  755. File: gettext.info,  Node: Information Flow,  Prev: Organization,  Up: Translators
  756.  
  757. Information Flow
  758. ================
  759.  
  760.    There will surely be some discussion about this messages after the
  761. packages are finally released.  If people now send you some proposals
  762. for better messages, how do you proceed?  Jim, please note that right
  763. now, as I put forward nearly a dozen of localizable programs, I receive
  764. both the translations and the coordination concerns about them.
  765.  
  766.    If I put one of my things to pretest, Ulrich receives the
  767. announcement and passes it on to the German team, who make last minute
  768. revisions.  Then he submits the translation files to me *as the
  769. maintainer*.  For GNU packages I do not maintain, I would not even hear
  770. about it.  This scheme could be made to work GNU-wide, I think.  For
  771. security reasons, maybe Ulrich (national coordinators, in fact) should
  772. update central registry kept by GNU (Jim, me, or Len's recruits) once in
  773. a while.
  774.  
  775.    In December/January, I was aggressively ready to internationalize
  776. all of GNU, giving myself the duty of one small GNU package per week or
  777. so, taking many weeks or months for bigger packages.  But it does not
  778. work this way.  I first did all the things I'm responsible for.  I've
  779. nothing against some missionary work on other maintainers, but I'm also
  780. loosing a lot of energy over it--same debates over again.
  781.  
  782.    And when the first localized packages are released we'll get a lot of
  783. responses about ugly translations :-).  Surely, and we need to have
  784. beforehand a fairly good idea about how to handle the information flow
  785. between the national teams and the package maintainers.
  786.  
  787.    Please start saving somewhere a quick history of each PO file.  I
  788. know for sure that the file format will change, allowing for comments.
  789. It would be nice that each file has a kind of log, and references for
  790. those who want to submit comments or gripes, or otherwise contribute.
  791. I sent a proposal for a fast and flexible format, but it is not
  792. receiving acceptance yet by the GNU deciders.  I'll tell you when I
  793. have more information about this.
  794.  
  795. 
  796. File: gettext.info,  Node: Maintainers,  Next: Conclusion,  Prev: Translators,  Up: Top
  797.  
  798. The Maintainer's View
  799. *********************
  800.  
  801.    The maintainer of a package has many responsibilities.  One of them
  802. is ensuring that the package will install easily on many platforms, and
  803. that the magic we described earlier (*note Users::.) will work for
  804. installers and end users.
  805.  
  806.    Of course, there are many possible ways by which GNU `gettext' might
  807. be integrated in a distribution, and this chapter does not cover them
  808. in all generality.  Instead, it details one possible approach which is
  809. especially adequate for many GNU distributions, because GNU `gettext'
  810. is purposely for helping the internationalization of the whole GNU
  811. project.  So, the maintainer's view presented here presumes that the
  812. package already has a `configure.in' file and uses GNU Autoconf.
  813.  
  814.    Nevertheless, GNU `gettext' may surely be useful for non-GNU
  815. packages, but the maintainers of such packages might have to show
  816. imagination and initiative in organizing their distributions so
  817. `gettext' work for them in all situations.  There are surely many, out
  818. there.
  819.  
  820.    Even if `gettext' methods are now stabilizing, slight adjustments
  821. might be needed between successive `gettext' versions, so you should
  822. ideally revise this chapter in subsequent releases, looking for changes.
  823.  
  824. * Menu:
  825.  
  826. * Flat and Non-Flat::           Flat or Non-Flat Directory Structures
  827. * Prerequisites::               Prerequisite Works
  828. * gettextize Invocation::       Invoking the `gettextize' Program
  829. * Adjusting Files::             Files You Must Create or Alter
  830.  
  831. 
  832. File: gettext.info,  Node: Flat and Non-Flat,  Next: Prerequisites,  Prev: Maintainers,  Up: Maintainers
  833.  
  834. Flat or Non-Flat Directory Structures
  835. =====================================
  836.  
  837.    Some GNU packages are distributed as `tar' files which unpack in a
  838. single directory, these are said to be "flat" distributions.  Other GNU
  839. packages have a one level hierarchy of subdirectories, using for
  840. example a subdirectory named `doc/' for the Texinfo manual and man
  841. pages, another called `lib/' for holding functions meant to replace or
  842. complement C libraries, and a subdirectory `src/' for holding the
  843. proper sources for the package.  These other distributions are said to
  844. be "non-flat".
  845.  
  846.    For now, we cannot say much about flat distributions.  A flat
  847. directory structure has the disadvantage of increasing the difficulty
  848. of updating to a new version of GNU `gettext'.  Also, if you have many
  849. PO files, this could somewhat pollute your single directory.  In the
  850. GNU `gettext' distribution, the `misc/' directory contains a shell
  851. script named `combine-sh'.  That script may be used for combining all
  852. the C files of the `intl/' directory into a pair of C files (one `.c'
  853. and one `.h').  Those two generated files would fit more easily in a
  854. flat directory structure, and you will then have to add these two files
  855. to your project.
  856.  
  857.    Maybe because GNU `gettext' itself has a non-flat structure, we have
  858. more experience with this approach, and this is what will be described
  859. in the remaining of this chapter.  Some maintainers might use this as
  860. an opportunity to unflatten their package structure.  Only later, once
  861. gained more experience adapting GNU `gettext' to flat distributions, we
  862. might add some notes about how to proceed in flat situations.
  863.  
  864. 
  865. File: gettext.info,  Node: Prerequisites,  Next: gettextize Invocation,  Prev: Flat and Non-Flat,  Up: Maintainers
  866.  
  867. Prerequisite Works
  868. ==================
  869.  
  870.    There are some works which are required for using GNU `gettext' in
  871. one of your package.  These works have some kind of generality that
  872. escape the point by point descriptions used in the remainder of this
  873. chapter.  So, we describe them here.
  874.  
  875.    * Before attempting to use you should install some other packages
  876.      first.  Ensure that recent versions of GNU `m4', GNU Autoconf and
  877.      GNU `gettext' are already installed at your site, and if not,
  878.      proceed to do this first.  If you got to install these things,
  879.      beware that GNU `m4' must be fully installed before GNU Autoconf
  880.      is even *configured*.
  881.  
  882.      To further ease the task of a package maintainer the `automake'
  883.      package was designed and implemented.  GNU `gettext' now uses this
  884.      tool and the `Makefile's in the `intl/' and `po/' therefore know
  885.      about all the goals necessary for using `automake' and `libintl'
  886.      in one project.
  887.  
  888.      Those four packages are only needed to you, as a maintainer; the
  889.      installers of your own package and end users do not really need
  890.      any of GNU `m4', GNU Autoconf, GNU `gettext', or GNU `automake'
  891.      for successfully installing and running your package, with messages
  892.      properly translated.  But this is not completely true if you
  893.      provide internationalized shell scripts within your own package:
  894.      GNU `gettext' shall then be installed at the user site if the end
  895.      users want to see the translation of shell script messages.
  896.  
  897.    * Your package should use Autoconf and have a `configure.in' file.
  898.      If it does not, you have to learn how.  The Autoconf documentation
  899.      is quite well written, it is a good idea that you print it and get
  900.      familiar with it.
  901.  
  902.    * Your C sources should have already been modified according to
  903.      instructions given earlier in this manual.  *Note Sources::.
  904.  
  905.    * Your `po/' directory should receive all PO files submitted to you
  906.      by the translator teams, each having `LL.po' as a name.  This is
  907.      not usually easy to get translation work done before your package
  908.      gets internationalized and available!  Since the cycle has to
  909.      start somewhere, the easiest for the maintainer is to start with
  910.      absolutely no PO files, and wait until various translator teams
  911.      get interested in your package, and submit PO files.
  912.  
  913.    It is worth adding here a few words about how the maintainer should
  914. ideally behave with PO files submissions.  As a maintainer, your role
  915. is to authentify the origin of the submission as being the
  916. representative of the appropriate GNU translating team (forward the
  917. submission to `gnu-translation@prep.ai.mit.edu' in case of doubt), to
  918. ensure that the PO file format is not severely broken and does not
  919. prevent successful installation, and for the rest, to merely to put
  920. these PO files in `po/' for distribution.
  921.  
  922.    As a maintainer, you do not have to take on your shoulders the
  923. responsibility of checking if the translations are adequate or
  924. complete, and should avoid diving into linguistic matters.  Translation
  925. teams drive themselves and are fully responsible of their linguistic
  926. choices for GNU.  Keep in mind that translator teams are *not* driven
  927. by maintainers.  You can help by carefully redirecting all
  928. communications and reports from users about linguistic matters to the
  929. appropriate translation team, or explain users how to reach or join
  930. their team.  The simplest might be to send them the `NLS' file.
  931.  
  932.    Maintainers should *never ever* apply PO file bug reports
  933. themselves, short-cutting translation teams.  If some translator has
  934. difficulty to get some of her points through her team, it should not be
  935. an issue for her to directly negotiate translations with maintainers.
  936. Teams ought to settle their problems themselves, if any.  If you, as a
  937. maintainer, ever think there is a real problem with a team, please
  938. never try to *solve* a team's problem on your own.
  939.  
  940. 
  941. File: gettext.info,  Node: gettextize Invocation,  Next: Adjusting Files,  Prev: Prerequisites,  Up: Maintainers
  942.  
  943. Invoking the `gettextize' Program
  944. =================================
  945.  
  946.    Some files are consistently and identically needed in every package
  947. internationalized through GNU `gettext'.  As a matter of convenience,
  948. the `gettextize' program puts all these files right in your package.
  949. This program has the following synopsis:
  950.  
  951.      gettextize [ OPTION... ] [ DIRECTORY ]
  952.  
  953. and accepts the following options:
  954.  
  955. `-c'
  956. `--copy'
  957.      Copy the needed files instead of making symbolic links.  Using
  958.      links would allow the package to always use the latest `gettext'
  959.      code available on the system, but it might disturb some mechanism
  960.      the maintainer is used to apply to the sources.  Because running
  961.      `gettextize' is easy there shouldn't be problems with using copies.
  962.  
  963. `-f'
  964. `--force'
  965.      Force replacement of files which already exist.
  966.  
  967. `-h'
  968. `--help'
  969.      Display this help and exit.
  970.  
  971. `--version'
  972.      Output version information and exit.
  973.  
  974.    If DIRECTORY is given, this is the top level directory of a package
  975. to prepare for using GNU `gettext'.  If not given, it is assumed that
  976. the current directory is the top level directory of such a package.
  977.  
  978.    The program `gettextize' provides the following files.  However, no
  979. existing file will be replaced unless the option `--force' (`-f') is
  980. specified.
  981.  
  982.   1. The `NLS' file is copied in the main directory of your package,
  983.      the one being at the top level.  This file gives the main
  984.      indications about how to install and use the Native Language
  985.      Support features of your program.  You might elect to use a more
  986.      recent copy of this `NLS' file than the one provided through
  987.      `gettextize', if you have one handy.  You may also fetch a more
  988.      recent copy of file `NLS' from most GNU archive sites.
  989.  
  990.   2. A `po/' directory is created for eventually holding all
  991.      translation files, but initially only containing the file
  992.      `po/Makefile.in.in' from the GNU `gettext' distribution.  (beware
  993.      the double `.in' in the file name). If the `po/' directory already
  994.      exists, it will be preserved along with the files it contains, and
  995.      only `Makefile.in.in' will be overwritten.
  996.  
  997.   3. A `intl/' directory is created and filled with most of the files
  998.      originally in the `intl/' directory of the GNU `gettext'
  999.      distribution.  Also, if option `--force' (`-f') is given, the
  1000.      `intl/' directory is emptied first.
  1001.  
  1002.  
  1003.    If your site support symbolic links, `gettextize' will not actually
  1004. copy the files into your package, but establish symbolic links instead.
  1005. This avoids duplicating the disk space needed in all packages.  Merely
  1006. using the `-h' option while creating the `tar' archive of your
  1007. distribution will resolve each link by an actual copy in the
  1008. distribution archive.  So, to insist, you really should use `-h' option
  1009. with `tar' within your `dist' goal of your main `Makefile.in'.
  1010.  
  1011.    It is interesting to understand that most new files for supporting
  1012. GNU `gettext' facilities in one package go in `intl/' and `po/'
  1013. subdirectories.  One distinction between these two directories is that
  1014. `intl/' is meant to be completely identical in all packages using GNU
  1015. `gettext', while all newly created files, which have to be different,
  1016. go into `po/'.  There is a common `Makefile.in.in' in `po/', because
  1017. the `po/' directory needs its own `Makefile', and it has been designed
  1018. so it can be identical in all packages.
  1019.  
  1020. 
  1021. File: gettext.info,  Node: Adjusting Files,  Prev: gettextize Invocation,  Up: Maintainers
  1022.  
  1023. Files You Must Create or Alter
  1024. ==============================
  1025.  
  1026.    Besides files which are automatically added through `gettextize',
  1027. there are many files needing revision for properly interacting with GNU
  1028. `gettext'.  If you are closely following GNU standards for Makefile
  1029. engineering and auto-configuration, the adaptations should be easier to
  1030. achieve.  Here is a point by point description of the changes needed in
  1031. each.
  1032.  
  1033.    So, here comes a list of files, each one followed by a description of
  1034. all alterations it needs.  Many examples are taken out from the GNU
  1035. `gettext' 0.10.24 distribution itself.  You may indeed refer to the
  1036. source code of the GNU `gettext' package, as it is intended to be a
  1037. good example and master implementation for using its own functionality.
  1038.  
  1039. * Menu:
  1040.  
  1041. * po/POTFILES::                 `POTFILES' in `po/'
  1042. * configure.in::                `configure.in' at top level
  1043. * aclocal::                     `aclocal.m4' at top level
  1044. * acconfig::                    `acconfig.h' at top level
  1045. * Makefile::                    `Makefile.in' at top level
  1046. * src/Makefile::                `Makefile.in' in `src/'
  1047.  
  1048. 
  1049. File: gettext.info,  Node: po/POTFILES,  Next: configure.in,  Prev: Adjusting Files,  Up: Adjusting Files
  1050.  
  1051. `POTFILES' in `po/'
  1052. -------------------
  1053.  
  1054.    The `po/' directory should receive a file named `POTFILES.in'.  This
  1055. file tells which files, among all program sources, have marked strings
  1056. needing translation.  Here is an example of such a file:
  1057.  
  1058.      # List of source files containing translatable strings.
  1059.      # Copyright (C) 1995 Free Software Foundation, Inc.
  1060.      
  1061.      # Common library files
  1062.      lib/error.c
  1063.      lib/getopt.c
  1064.      lib/xmalloc.c
  1065.      
  1066.      # Package source files
  1067.      src/gettextp.c
  1068.      src/msgfmt.c
  1069.      src/xgettext.c
  1070.  
  1071. Dashed comments and white lines are ignored.  All other lines list
  1072. those source files containing strings marked for translation (*note
  1073. Mark Keywords::.), in a notation relative to the top level of your
  1074. whole distribution, rather than the location of the `POTFILES.in' file
  1075. itself.
  1076.  
  1077.