org.xnap.i18n
Class I18n

java.lang.Object
  extended by org.xnap.i18n.I18n

public class I18n
extends java.lang.Object

Provides methods for internationalization.


Constructor Summary
I18n()
           
 
Method Summary
static java.util.ResourceBundle getResources()
          Returns the currently used message bundle.
static java.lang.String marktr(java.lang.String text)
          Marks text to be translated, but doesn't translate it.
static void setResources(java.util.ResourceBundle resources)
          Sets the resource bundle.
static void setResources(java.lang.String location)
          Loads a resource bundle from location, using the default locale.
static java.lang.String tr(java.lang.String text)
          Returns text translated into the currently selected language.
static java.lang.String tr(java.lang.String text, int padding)
          Returns text translated into the currently selected language.
static java.lang.String tr(java.lang.String text, int lpadding, int rpadding)
          Returns text translated into the currently selected language.
static java.lang.String tr(java.lang.String text, java.lang.Object o1)
          Returns text translated into the currently selected language.
static java.lang.String tr(java.lang.String text, java.lang.Object o1, java.lang.Object o2)
          Returns text translated into the currently selected language.
static java.lang.String tr(java.lang.String text, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
          Returns text translated into the currently selected language.
static java.lang.String tr(java.lang.String text, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
          Returns text translated into the currently selected language.
static java.lang.String trc(java.lang.String comment, java.lang.String text)
          Disambiguates translation keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18n

public I18n()
Method Detail

getResources

public static final java.util.ResourceBundle getResources()
Returns the currently used message bundle.


setResources

public static final void setResources(java.lang.String location)
Loads a resource bundle from location, using the default locale.


setResources

public static final void setResources(java.util.ResourceBundle resources)
Sets the resource bundle.


marktr

public static final java.lang.String marktr(java.lang.String text)
Marks text to be translated, but doesn't translate it.


tr

public static final java.lang.String tr(java.lang.String text)
Returns text translated into the currently selected language. Every user-visible string in the program must be wrapped into this function.


tr

public static final java.lang.String tr(java.lang.String text,
                                        java.lang.Object o1)
Returns text translated into the currently selected language.

The first occurence of {0} is replaced by o1.toString().


trc

public static final java.lang.String trc(java.lang.String comment,
                                         java.lang.String text)
Disambiguates translation keys.

Parameters:
comment - the text translated + a disambiguation hint in brackets.
text - the ambiguous key string

tr

public static final java.lang.String tr(java.lang.String text,
                                        java.lang.Object o1,
                                        java.lang.Object o2)
Returns text translated into the currently selected language.

The first occurence of {0} is replaced by o1.toString(). The first occurence of {1} is replaced by o2.toString().


tr

public static final java.lang.String tr(java.lang.String text,
                                        java.lang.Object o1,
                                        java.lang.Object o2,
                                        java.lang.Object o3)
Returns text translated into the currently selected language.

The first occurence of {0} is replaced by o1.toString(). The first occurence of {1} is replaced by o2.toString(). The first occurence of {2} is replaced by o3.toString().


tr

public static final java.lang.String tr(java.lang.String text,
                                        java.lang.Object o1,
                                        java.lang.Object o2,
                                        java.lang.Object o3,
                                        java.lang.Object o4)
Returns text translated into the currently selected language.

The first occurence of {0} is replaced by o1.toString(). The first occurence of {1} is replaced by o2.toString(). The first occurence of {2} is replaced by o3.toString(). The first occurence of {3} is replaced by o4.toString().


tr

public static final java.lang.String tr(java.lang.String text,
                                        int padding)
Returns text translated into the currently selected language. Prepends and appends padding whitespaces.


tr

public static final java.lang.String tr(java.lang.String text,
                                        int lpadding,
                                        int rpadding)
Returns text translated into the currently selected language. Prepends lpadding whitespaces. Appends rpadding whitespaces.



Copyright © 2001-2005 XNap Team. All Rights Reserved.