"abc"
@item gettext shorthand
-_("abc")
+i18n("abc")
@item gettext/ngettext functions
@code{GettextResource.gettext}, @code{GettextResource.ngettext},
---, uses a Java specific message catalog format
@item Extractor
-@code{xgettext -k_}
+@code{xgettext -ki18n}
@item Formatting with positions
@code{MessageFormat.format "@{1,number@} @{0,number@}"}
@smallexample
private static ResourceBundle myResources =
ResourceBundle.getBundle("domain-name");
-public static String _(String s) @{
+public static String i18n(String s) @{
return myResources.getString(s);
@}
@end smallexample
All classes containing internationalized strings then contain
@smallexample
-import static Util._;
+import static Util.i18n;
@end smallexample
@noindent
and the shorthand is used like this:
@smallexample
-System.out.println(_("Operation completed."));
+System.out.println(i18n("Operation completed."));
@end smallexample
@item
@smallexample
private static ResourceBundle res = Util.myResources;
-private static String _(String s) @{ return res.getString(s); @}
+private static String i18n(String s) @{ return res.getString(s); @}
@end smallexample
@noindent
and the shorthand is used like this:
@smallexample
-System.out.println(_("Operation completed."));
+System.out.println(i18n("Operation completed."));
@end smallexample
@item
public class S @{
public static ResourceBundle myResources =
ResourceBundle.getBundle("domain-name");
- public static String _(String s) @{
+ public static String i18n(String s) @{
return myResources.getString(s);
@}
@}
and the shorthand is used like this:
@smallexample
-System.out.println(S._("Operation completed."));
+System.out.println(S.i18n("Operation completed."));
@end smallexample
@end itemize