|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vividsolutions.jump.I18N
public final class I18N
Singleton for the Internationalization (I18N)
[1] HOWTO TRANSLATE JUMP IN MY OWN LANGUAGE Copy theses files and add the locales extension for your language and country instead of the *. - resources/jump_*.properties - com/vividsolutions/jump/workbench/ui/plugin/KeyboardPlugIn_*.html [2] HOWTO TRANSLATE MY PLUGIN AND GIVE THE ABILITY TO TRANSLATE IT Use theses methods to use your own *.properties files : [Michael Michaud 2007-03-23] the 3 following methods have been deactivated com.vividsolutions.jump.I18N#setPlugInRessource(String, String) com.vividsolutions.jump.I18N#get(String, String) com.vividsolutions.jump.I18N#getMessage(String, String, Object[]) you still can use plugInsResourceBundle (as in Pirol's plugin) And use jump standard menusCode example : [Michael Michaud 2007-03-23 : the following code example is no more valid and has to be changed]
public class PrintPlugIn extends AbstractPlugIn
{
private String name = "print";
public void initialize(PlugInContext context) throws Exception
{
I18N.setPlugInRessource(name, "org.agil.core.jump.plugin.print");
context.getFeatureInstaller().addMainMenuItem(this,
new String[]
{MenuNames.TOOLS,I18N.get(name, "print")},
I18N.get(name, "print"), false, null, null);
}
...
TODO :I18N (1) Improve translations TODO :I18N (2) Separate config (customization) and I18N TODO :I18N (3) Explore and discuss about I18N integration and Jakarta Common Ressources (using it as a ressource interface)
MenuNames,
text rotation| Field Summary | |
|---|---|
static java.util.Hashtable |
plugInsResourceBundle
|
static java.util.ResourceBundle |
rb
|
| Method Summary | |
|---|---|
static java.lang.String |
get(java.lang.String label)
Process text with the locale 'jump_ |
static I18N |
getInstance()
|
static I18N |
getInstance(java.lang.String category)
Get the I18N instance for the category. |
static java.lang.String |
getLanguage()
Get the short signature for language (letters extension :language 2 letters) |
static java.lang.String |
getLocale()
Get the short signature for locale (letters extension :language 2 letters + "_" + country 2 letters) |
static java.lang.String |
getMessage(java.lang.String label,
java.lang.Object[] objects)
Process text with the locale 'jump_ |
static java.lang.String |
getMessage(java.lang.String category,
java.lang.String label,
java.lang.Object[] objects)
Get the I18N text from the language file associated with the specified category. |
java.lang.String |
getText(java.lang.String key)
Get the I18N text from the language file associated with this instance. |
static java.lang.String |
getText(java.lang.String category,
java.lang.String key)
Get the I18N text from the language file associated with the specified category. |
static void |
loadFile(java.lang.String langcountry)
Load file specified in command line (-i18n lang_country) (lang_country :language 2 letters + "_" + country 2 letters) Tries first to extract lang and country, and if only lang is specified, loads the corresponding resource bundle. |
static void |
setClassLoader(java.lang.ClassLoader classLoader)
Set the class loader used to load resource bundles, must only be called by the plug-in loader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.ResourceBundle rb
public static java.util.Hashtable plugInsResourceBundle
| Method Detail |
|---|
public static void setClassLoader(java.lang.ClassLoader classLoader)
classLoader - the classLoader to setpublic java.lang.String getText(java.lang.String key)
key - The key of the text in the language file.
public static java.lang.String getText(java.lang.String category,
java.lang.String key)
category - The category.key - The key of the text in the language file.
public static I18N getInstance(java.lang.String category)
category - The category.
public static I18N getInstance()
public static void loadFile(java.lang.String langcountry)
langcountry - public static java.lang.String get(java.lang.String label)
label -
public static java.lang.String getLocale()
public static java.lang.String getLanguage()
public static java.lang.String getMessage(java.lang.String label,
java.lang.Object[] objects)
label - with argument insertion : {0}objects -
public static java.lang.String getMessage(java.lang.String category,
java.lang.String label,
java.lang.Object[] objects)
category - The category.label - with argument insertion : {0}objects -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||