1*946379e7Schristos<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2*946379e7Schristos<!--NewPage-->
3*946379e7Schristos<html>
4*946379e7Schristos<head>
5*946379e7Schristos<!-- Generated by javadoc on Sat Nov 03 18:12:01 CET 2001 -->
6*946379e7Schristos<title>
7*946379e7Schristos  Class gnu.gettext.GettextResource
8*946379e7Schristos</title>
9*946379e7Schristos</head>
10*946379e7Schristos<body>
11*946379e7Schristos<a name="_top_"></a>
12*946379e7Schristos<pre>
13*946379e7Schristos<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-gnu.gettext.html">This Package</a>  <a href="Package-gnu.gettext.html">Previous</a>  <a href="Package-gnu.gettext.html">Next</a>  <a href="AllNames.html">Index</a></pre>
14*946379e7Schristos<hr>
15*946379e7Schristos<h1>
16*946379e7Schristos  Class gnu.gettext.GettextResource
17*946379e7Schristos</h1>
18*946379e7Schristos<pre>
19*946379e7Schristosjava.lang.Object
20*946379e7Schristos   |
21*946379e7Schristos   +----java.util.ResourceBundle
22*946379e7Schristos           |
23*946379e7Schristos           +----gnu.gettext.GettextResource
24*946379e7Schristos</pre>
25*946379e7Schristos<hr>
26*946379e7Schristos<dl>
27*946379e7Schristos  <dt> public abstract class <b>GettextResource</b>
28*946379e7Schristos  <dt> extends ResourceBundle
29*946379e7Schristos</dl>
30*946379e7SchristosThis class implements the main GNU libintl functions in Java.
31*946379e7Schristos <P>
32*946379e7Schristos Using the GNU gettext approach, compiled message catalogs are normal
33*946379e7Schristos Java ResourceBundle classes and are thus interoperable with standard
34*946379e7Schristos ResourceBundle based code.
35*946379e7Schristos <P>
36*946379e7Schristos The main differences between the Sun ResourceBundle approach and the
37*946379e7Schristos GNU gettext approach are:
38*946379e7Schristos <UL>
39*946379e7Schristos   <LI>In the Sun approach, the keys are abstract textual shortcuts.
40*946379e7Schristos       In the GNU gettext approach, the keys are the English/ASCII version
41*946379e7Schristos       of the messages.
42*946379e7Schristos   <LI>In the Sun approach, the translation files are called
43*946379e7Schristos       "<VAR>Resource</VAR>_<VAR>locale</VAR>.properties" and have non-ASCII
44*946379e7Schristos       characters encoded in the Java
45*946379e7Schristos       <CODE>\</CODE><CODE>u<VAR>nnnn</VAR></CODE> syntax. Very few editors
46*946379e7Schristos       can natively display international characters in this format. In the
47*946379e7Schristos       GNU gettext approach, the translation files are called
48*946379e7Schristos       "<VAR>Resource</VAR>.<VAR>locale</VAR>.po"
49*946379e7Schristos       and are in the encoding the translator has chosen. Many editors
50*946379e7Schristos       can be used. There are at least three GUI translating tools
51*946379e7Schristos       (Emacs PO mode, KDE KBabel, GNOME gtranslator).
52*946379e7Schristos   <LI>In the Sun approach, the function
53*946379e7Schristos       <CODE>ResourceBundle.getString</CODE> throws a
54*946379e7Schristos       <CODE>MissingResourceException</CODE> when no translation is found.
55*946379e7Schristos       In the GNU gettext approach, the <CODE>gettext</CODE> function
56*946379e7Schristos       returns the (English) message key in that case.
57*946379e7Schristos   <LI>In the Sun approach, there is no support for plural handling.
58*946379e7Schristos       Even the most elaborate MessageFormat strings cannot provide decent
59*946379e7Schristos       plural handling. In the GNU gettext approach, we have the
60*946379e7Schristos       <CODE>ngettext</CODE> function.
61*946379e7Schristos </UL>
62*946379e7Schristos <P>
63*946379e7Schristos To compile GNU gettext message catalogs into Java ResourceBundle classes,
64*946379e7Schristos the <CODE>msgfmt</CODE> program can be used.
65*946379e7Schristos<p>
66*946379e7Schristos<hr>
67*946379e7Schristos<a name="index"></a>
68*946379e7Schristos<h2>
69*946379e7Schristos  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
70*946379e7Schristos</h2>
71*946379e7Schristos<dl>
72*946379e7Schristos  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
73*946379e7Schristos	<a href="#verbose"><b>verbose</b></a>
74*946379e7Schristos  <dd>
75*946379e7Schristos</dl>
76*946379e7Schristos<h2>
77*946379e7Schristos  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
78*946379e7Schristos</h2>
79*946379e7Schristos<dl>
80*946379e7Schristos  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
81*946379e7Schristos	<a href="#GettextResource()"><b>GettextResource</b></a>()
82*946379e7Schristos  <dd>
83*946379e7Schristos</dl>
84*946379e7Schristos<h2>
85*946379e7Schristos  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
86*946379e7Schristos</h2>
87*946379e7Schristos<dl>
88*946379e7Schristos  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
89*946379e7Schristos	<a href="#gettext(java.util.ResourceBundle, java.lang.String)"><b>gettext</b></a>(ResourceBundle, String)
90*946379e7Schristos  <dd>  Returns the translation of <VAR>msgid</VAR>.
91*946379e7Schristos  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
92*946379e7Schristos	<a href="#ngettext(java.util.ResourceBundle, java.lang.String, java.lang.String, long)"><b>ngettext</b></a>(ResourceBundle, String, String, long)
93*946379e7Schristos  <dd>  Returns the plural form for <VAR>n</VAR> of the translation of
94*946379e7Schristos <VAR>msgid</VAR>.
95*946379e7Schristos</dl>
96*946379e7Schristos<a name="variables"></a>
97*946379e7Schristos<h2>
98*946379e7Schristos  <img src="images/variables.gif" width=153 height=38 alt="Variables">
99*946379e7Schristos</h2>
100*946379e7Schristos<a name="verbose"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
101*946379e7Schristos<b>verbose</b>
102*946379e7Schristos<pre>
103*946379e7Schristos public static boolean verbose
104*946379e7Schristos</pre>
105*946379e7Schristos<a name="constructors"></a>
106*946379e7Schristos<h2>
107*946379e7Schristos  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
108*946379e7Schristos</h2>
109*946379e7Schristos<a name="GettextResource"></a>
110*946379e7Schristos<a name="GettextResource()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
111*946379e7Schristos<b>GettextResource</b>
112*946379e7Schristos<pre>
113*946379e7Schristos public GettextResource()
114*946379e7Schristos</pre>
115*946379e7Schristos<a name="methods"></a>
116*946379e7Schristos<h2>
117*946379e7Schristos  <img src="images/methods.gif" width=151 height=38 alt="Methods">
118*946379e7Schristos</h2>
119*946379e7Schristos<a name="gettext(java.util.ResourceBundle, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
120*946379e7Schristos<a name="gettext"><b>gettext</b></a>
121*946379e7Schristos<pre>
122*946379e7Schristos public static String gettext(ResourceBundle catalog,
123*946379e7Schristos                              String msgid)
124*946379e7Schristos</pre>
125*946379e7Schristos<dl>
126*946379e7Schristos  <dd> Returns the translation of <VAR>msgid</VAR>.
127*946379e7Schristos<p>
128*946379e7Schristos  <dd><dl>
129*946379e7Schristos    <dt> <b>Parameters:</b>
130*946379e7Schristos    <dd> catalog - a ResourceBundle
131*946379e7Schristos    <dd> msgid - the key string to be translated, an ASCII string
132*946379e7Schristos    <dt> <b>Returns:</b>
133*946379e7Schristos    <dd> the translation of <VAR>msgid</VAR>, or <VAR>msgid</VAR> if
134*946379e7Schristos         none is found
135*946379e7Schristos  </dl></dd>
136*946379e7Schristos</dl>
137*946379e7Schristos<a name="ngettext(java.util.ResourceBundle, java.lang.String, java.lang.String, long)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
138*946379e7Schristos<a name="ngettext"><b>ngettext</b></a>
139*946379e7Schristos<pre>
140*946379e7Schristos public static String ngettext(ResourceBundle catalog,
141*946379e7Schristos                               String msgid,
142*946379e7Schristos                               String msgid_plural,
143*946379e7Schristos                               long n)
144*946379e7Schristos</pre>
145*946379e7Schristos<dl>
146*946379e7Schristos  <dd> Returns the plural form for <VAR>n</VAR> of the translation of
147*946379e7Schristos <VAR>msgid</VAR>.
148*946379e7Schristos<p>
149*946379e7Schristos  <dd><dl>
150*946379e7Schristos    <dt> <b>Parameters:</b>
151*946379e7Schristos    <dd> catalog - a ResourceBundle
152*946379e7Schristos    <dd> msgid - the key string to be translated, an ASCII string
153*946379e7Schristos    <dd> msgid_plural - its English plural form
154*946379e7Schristos    <dt> <b>Returns:</b>
155*946379e7Schristos    <dd> the translation of <VAR>msgid</VAR> depending on <VAR>n</VAR>,
156*946379e7Schristos         or <VAR>msgid</VAR> or <VAR>msgid_plural</VAR> if none is found
157*946379e7Schristos  </dl></dd>
158*946379e7Schristos</dl>
159*946379e7Schristos<hr>
160*946379e7Schristos<pre>
161*946379e7Schristos<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-gnu.gettext.html">This Package</a>  <a href="Package-gnu.gettext.html">Previous</a>  <a href="Package-gnu.gettext.html">Next</a>  <a href="AllNames.html">Index</a></pre>
162*946379e7Schristos</body>
163*946379e7Schristos</html>
164