|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.util.I18N
public class I18N
Simple utility class for accessing property file resource bundles for internationalization.
This class assumes one property file per package, as needed. The convention
used here is to store the property files in a subdirectory of the package
named i18n
. The base name is gui
, so the default
property file is i18n/gui.properties
. The German version would then
be i18n/gui_de.properties
and the French version would be
i18n/gui_fr.properties
. The property files need to be installed
in the same relative directory in the classes dir or jar file before use.
Method Summary | |
---|---|
static I18N |
getInstance(java.lang.Class c)
Return an instance of I18N, initialized to use i18n/gui_ |
java.lang.String |
getString(java.lang.String key)
Return the string for the specified key in the current locale. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object p1)
Return the string for the specified key in the current locale after substituting the given parameter using the MessageFormat class. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object[] params)
Return the string for the specified key in the current locale after substituting the given parameters using the MessageFormat class. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object p1,
java.lang.Object p2)
Return the string for the specified key in the current locale after substituting the given parameters (p1 and p2) using the MessageFormat class. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3)
Return the string for the specified key in the current locale after substituting the given parameters (p1 and p2) using the MessageFormat class. |
static void |
main(java.lang.String[] args)
test main |
void |
setLocale(java.util.Locale locale)
Set the current locale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static I18N getInstance(java.lang.Class c)
public void setLocale(java.util.Locale locale)
public java.lang.String getString(java.lang.String key)
public java.lang.String getString(java.lang.String key, java.lang.Object[] params)
MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object p1)
MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object p1, java.lang.Object p2)
MessageFormat
public java.lang.String getString(java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
MessageFormat
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |