|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpicedt.Localizer
public class Localizer
Localizer for all classes of the jpicedt's tree.
It uses "lang/i18n_xx_yy.properties" resource file, where xx_yy is the Locale.
If not found, uses "lang/i18n.properties" (same as i18n_en.properties)
As of 2005/12, support for localized help-files added by Jobst Hoffmann.
Field Summary | |
---|---|
static String |
KEY_LANGUAGE
the key used to retrieve the locale from the preferences file |
Constructor Summary | |
---|---|
Localizer()
Create a new Localizer instance init'd from the default locale |
|
Localizer(Properties preferences)
Create a new Localizer instance init'd from the given Properties object |
Method Summary | |
---|---|
static Localizer |
currentLocalizer()
|
String |
get(String key)
|
ActionLocalizer |
getActionLocalizer()
|
String |
getCurrentDisplayLanguage()
Return the current Locale for this Localizer |
Locale |
getCurrentLocale()
Return the current Locale for this Localizer |
String |
getDefaultLanguage()
|
String[] |
getSupportedDisplayLanguages()
Return an array containing all languages this localizer supports, returned in the same format as Locale.getDisplayLanguage(inLocale), yet localized using the current Locale e.g. |
Locale[] |
getSupportedLocales()
Return an array containing all Locales this localizer supports, by looking up the "lang/" subdirectory. |
void |
init()
Init ResourceBundle using OS's default Locale |
void |
init(Properties preferences)
(Re)init from a Properties object. |
boolean |
isLocaleSupported(Locale l)
|
static String |
localize(String s)
Convenience call to currentLocalizer().get() |
static String[] |
localize(String[] s)
Pour appeler localize sur un tableau de chaînes. |
static void |
setCurrentLocalizer(Localizer aLocalizer)
set the Localizer that should be used for the jpicedt's class library |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KEY_LANGUAGE
Constructor Detail |
---|
public Localizer()
public Localizer(Properties preferences)
Method Detail |
---|
public static Localizer currentLocalizer()
public static void setCurrentLocalizer(Localizer aLocalizer)
public static String localize(String s)
public static String[] localize(String[] s)
localize
sur un tableau de chaînes.
public boolean isLocaleSupported(Locale l)
public Locale[] getSupportedLocales()
public String[] getSupportedDisplayLanguages()
public Locale getCurrentLocale()
public String getCurrentDisplayLanguage()
public String getDefaultLanguage()
public void init()
public void init(Properties preferences)
First a Locale is fetched from the given Properties object, using key=PREFERENCE_KEY (values having to be valid ISO639 codes acceptable by the Locale constructor) then a ResourceBundle is loaded using this Locale. Finally, the current Locale is written back to the given Properties to reflect change (if any, e.g. if the Locale was not found in the Properties object).
public String get(String key)
public ActionLocalizer getActionLocalizer()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |