All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.util.ResourceBundle | +----gnu.gettext.GettextResource
Using the GNU gettext approach, compiled message catalogs are normal Java ResourceBundle classes and are thus interoperable with standard ResourceBundle based code.
The main differences between the Sun ResourceBundle approach and the GNU gettext approach are:
\
unnnn
syntax. Very few editors
can natively display international characters in this format. In the
GNU gettext approach, the translation files are called
"Resource.locale.po"
and are in the encoding the translator has chosen. Many editors
can be used. There are at least three GUI translating tools
(Emacs PO mode, KDE KBabel, GNOME gtranslator).
ResourceBundle.getString
throws a
MissingResourceException
when no translation is found.
In the GNU gettext approach, the gettext
function
returns the (English) message key in that case.
ngettext
function.
To compile GNU gettext message catalogs into Java ResourceBundle classes,
the msgfmt
program can be used.
public static boolean verbose
public GettextResource()
public static String gettext(ResourceBundle catalog, String msgid)
public static String ngettext(ResourceBundle catalog, String msgid, String msgid_plural, long n)
All Packages Class Hierarchy This Package Previous Next Index