|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.i18n.I18n
public class I18n
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 |
---|
public I18n()
Method Detail |
---|
public static final java.util.ResourceBundle getResources()
public static final void setResources(java.lang.String location)
public static final void setResources(java.util.ResourceBundle resources)
public static final java.lang.String marktr(java.lang.String text)
text
to be translated, but doesn't translate it.
public static final java.lang.String tr(java.lang.String text)
text
translated into the currently selected
language. Every user-visible string in the program must be wrapped
into this function.
public static final java.lang.String tr(java.lang.String text, java.lang.Object o1)
text
translated into the currently selected
language.
The first occurence of {0} is replaced by o1.toString()
.
public static final java.lang.String trc(java.lang.String comment, java.lang.String text)
comment
- the text translated + a disambiguation hint in brackets.text
- the ambiguous key stringpublic static final java.lang.String tr(java.lang.String text, java.lang.Object o1, java.lang.Object o2)
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()
.
public static final java.lang.String tr(java.lang.String text, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
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()
.
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)
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()
.
public static final java.lang.String tr(java.lang.String text, int padding)
text
translated into the currently selected
language. Prepends and appends padding
whitespaces.
public static final java.lang.String tr(java.lang.String text, int lpadding, int rpadding)
text
translated into the currently selected
language. Prepends lpadding
whitespaces. Appends
rpadding
whitespaces.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |