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