From: Bruno Haible Date: Tue, 30 Oct 2001 11:09:05 +0000 (+0000) Subject: Misc. improvements. X-Git-Tag: v0.11~376 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47ec09559ea566eb8e835e1a83c70a9dbeb72d3d;p=thirdparty%2Fgettext.git Misc. improvements. --- diff --git a/doc/ChangeLog b/doc/ChangeLog index 5e253f56a..4da2fbd74 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,14 @@ +2001-10-21 Bruno Haible + + * gettext.texi (Header Entry): The language-team address can be an + URL instead of an email address. + (Plural forms): Gaeilge is also known as Irish. + (src/Makefile): No need to put libsupport.a into LIBS twice. + (Java): Add more documentation. + (Pascal): Likewise. + (YCP): Likewise. + (RST): Update. + 2001-10-19 Bruno Haible * texi2html: New file, from texi2html-1.52 with modifications. diff --git a/doc/gettext.texi b/doc/gettext.texi index ad4876d9b..d3d51b230 100644 --- a/doc/gettext.texi +++ b/doc/gettext.texi @@ -1975,8 +1975,8 @@ when you save the file. Fill in your name and email address (without double quotes). @item Language-Team -Fill in the English name of the language, and the email address of the -language team you are part of. +Fill in the English name of the language, and the email address or +homepage URL of the language team you are part of. Before starting a translation, it is a good idea to get in touch with your translation team, not only to make sure you don't do duplicated work, @@ -3893,7 +3893,7 @@ Languages with this property include: @table @asis @item Celtic -Gaeilge +Gaeilge (Irish) @end table @item Three forms, special case for numbers ending in 1[2-9] @@ -5432,12 +5432,12 @@ find a directory @file{lib/} in which a library containing some helper functions will be build. (You need at least the few functions which the GNU @code{gettext} Library itself needs.) However some of the functions in the @file{lib/} also give messages to the user which of course should be -translated, too. Taking care of this it is not enough to place the support -library (say @file{libsupport.a}) just between the @code{@@INTLLIBS@@} -and @code{@@LIBS@@} in the above example. Instead one has to write this: +translated, too. Taking care of this, the support library (say +@file{libsupport.a}) should be placed before @code{@@INTLLIBS@@} and +@code{@@LIBS@@} in the above example. So one has to write this: @example -LIBS = ../lib/libsupport.a @@INTLLIBS@@ ../lib/libsupport.a @@LIBS@@ +LIBS = ../lib/libsupport.a @@INTLLIBS@@ @@LIBS@@ @end example @item @@ -6072,16 +6072,16 @@ java, java2 "abc" @item gettext shorthand ---- +_("abc") @item gettext/ngettext functions ---- +@code{GettextResource.gettext}, @code{GettextResource.ngettext} @item textdomain ---- +---, use @code{ResourceBundle.getResource} instead @item bindtextdomain ---- +---, use CLASSPATH instead @item setlocale automatic @@ -6090,10 +6090,10 @@ automatic --- @item Use or emulate GNU gettext -emulate +---, uses a Java specific message catalog format @item Extractor ---- +@code{xgettext -k_} @item Formatting with positions @code{MessageFormat.format "@{1,number@} @{0,number@}"} @@ -6105,6 +6105,48 @@ fully portable --- @end table +Before marking strings as internationalizable, uses of the string +concatenation operator need to be converted to @code{MessageFormat} +applications. For example, @code{"file "+filename+" not found"} becomes +@code{MessageFormat.format("file @{0@} not found", new Object[] @{ filename @})}. +Only after this is done, can the strings be marked and extracted. + +GNU gettext uses the native Java internationalization mechanism, namely +@code{ResourceBundle}s. To convert a PO file to a ResourceBundle, the +@code{msgfmt} program can be used with the option @code{--java} or +@code{--java2}. To convert a ResourceBundle back to a PO file, the +@code{msgunfmt} program can be used with the option @code{--java}. + +Two different programmatic APIs can be used to access ResourceBundles. +Note that both APIs work with all kinds of ResourceBundles, whether +GNU gettext generated classes, or other @code{.class} or @code{.properties} +files. + +@enumerate +@item +The @code{java.util.ResourceBundle} API. + +In particular, its @code{getString} function returns a string translation. +Note that a missing translation yields a @code{MissingResourceException}. + +This has the advantage of being the standard API. And it does not require +any additional libraries, only the @code{msgfmt} generated @code{.class} +files. But it cannot do plural handling, even if the resource was generated +from a PO file with plural handling. + +@item +The @code{gnu.gettext.GettextResource} API. + +Its @code{gettext} function returns a string translation. Note that when +a translation is missing, the @var{msgid} argument is returned unchanged. + +This has the advantage of having the @code{ngettext} function for plural +handling. + +To use this API, one needs the @code{libintl.jar} file which is part of +the GNU gettext package and distributed under the LGPL. +@end enumerate + @node gawk, Pascal, Java, List of Programming Languages @subsection GNU awk @@ -6161,7 +6203,7 @@ define @code{dcgettext} and @code{bindtextdomain} yourself. fpk @item File extension -@code{pp} +@code{pp}, @code{pas} @item String syntax @code{'abc'} @@ -6173,25 +6215,25 @@ automatic ---, use @code{ResourceString} data type instead @item textdomain ----, use @code{TranslateResourcestrings} function instead +---, use @code{TranslateResourceStrings} function instead @item bindtextdomain ----, use @code{TranslateResourcestrings} function instead +---, use @code{TranslateResourceStrings} function instead @item setlocale automatic, but uses only LANG, not LC_MESSAGES or LC_ALL @item Prerequisite -@code{uses gettext;} +@code{@{$mode delphi@}} or @code{@{$mode objfpc@}}@*@code{uses gettext;} @item Use or emulate GNU gettext emulate partially @item Extractor -? +@code{ppc386} followed by @code{xgettext} or @code{rstconv} @item Formatting with positions -? +@code{uses sysutils;}@*@code{format "%1:d %0:d"} @item Portability ? @@ -6200,6 +6242,12 @@ emulate partially --- @end table +The Pascal compiler has special support for the @code{ResourceString} data +type. It generates a @code{.rst} file. This is then converted to a @code{.pot} +file by use of @code{xgettext} or @code{rstconv}. At runtime, a @code{.mo} +file corresponding to translations of this @code{.pot} file can be loaded +using the @code{TranslateResourceStrings} function in the @code{gettext} unit. + @node wxWindows, YCP, Pascal, List of Programming Languages @subsection wxWindows library @@ -6235,7 +6283,7 @@ wxGTK, gettext emulate, see @code{include/wx/intl.h} and @code{src/common/intl.cpp} @item Extractor -xgettext +@code{xgettext} @item Formatting with positions --- @@ -6252,7 +6300,7 @@ yes @table @asis @item RPMs -libycp, libycp-devel +libycp, libycp-devel, yast2-core-translator @item File extension @code{ycp} @@ -6264,7 +6312,7 @@ libycp, libycp-devel @code{_("abc")} @item gettext/ngettext functions ---- +@code{_()} with 1 or 3 arguments @item textdomain @code{textdomain} statement @@ -6282,7 +6330,7 @@ libycp, libycp-devel use maps instead @item Extractor ---- +@code{xgettext} @item Formatting with positions @code{sformat "%2 %1"} @@ -6510,7 +6558,7 @@ fpk @code{rst} @item Extractor -@code{rstconv} +@code{xgettext}, @code{rstconv} @end table @c This is the template for new data formats.