Class I18N
java.lang.Object
com.vividsolutions.jump.I18N
Singleton for the Internationalization (I18N)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyToRuntime(Locale loc) Utility method.static Localeutility method to convert a simplified locale string e.g.Get the internationalized text from the resource bundle associated with the specified category or path.static StringGet the short signature for country (2 letter code) of the default instancestatic I18NReturn the default I18N singleton for OJ2 for use like I18N.getInstance().get()static I18NgetInstance(File path) Create invalid input: '&' return the I18N instance for the given pathstatic I18NgetInstance(String categoryPrefix) Create invalid input: '&' return the I18N instance for the given prefixstatic StringGet the short signature for language (letters extension :language 2 letters) of the default instancestatic Localestatic StringGet the short signature for locale (letters extension :language 2 letters + "_" + country 2 letters)static voidreset()static voidSet the class loader used to load resource bundles, must be called by the PlugInManager (plugin jars are added to a child classloader there) to allow plugins to make use of this I18N class.static voidsetEncoding(String csname) static voidSet locale from string and (re)init
-
Field Details
-
JUMP
-
-
Method Details
-
reset
public static void reset() -
setClassLoader
Set the class loader used to load resource bundles, must be called by the PlugInManager (plugin jars are added to a child classloader there) to allow plugins to make use of this I18N class.- Parameters:
cl- the classLoader to set
-
setLocale
Set locale from string and (re)init- Parameters:
localeNew- the code for the lang and country locale to set
-
getLocale
-
setEncoding
-
getInstance
-
getInstance
-
getInstance
Return the default I18N singleton for OJ2 for use like I18N.getInstance().get()- Returns:
- singleton I18N object for OpenJUMP
-
fromCode
-
applyToRuntime
Utility method. Applies a given locale to the java runtime.- Parameters:
loc- the Locale to apply
-
getLocaleString
Get the short signature for locale (letters extension :language 2 letters + "_" + country 2 letters)- Returns:
- string signature for locale
-
getLanguage
Get the short signature for language (letters extension :language 2 letters) of the default instance- Returns:
- string signature for language
-
getCountry
Get the short signature for country (2 letter code) of the default instance- Returns:
- string signature for country
-
get
-
get
Get the internationalized text from the resource bundle associated with the specified category or path. If no label is defined then a default string is created from the last part of the key. Supports re-usage of translations in default instance via '$J:' prefix. e.g. some.other.key = $J:reusable.generic.translation will be looked up and the content of reusable.generic.translation = some cool translation returned. Examples: categoryPrefixOrPathOrI18N instanceof I18N legacy option, mainly for the instance method this.getText(String) categoryPrefixOrPathOrI18N = new String("org.openjump.myplugin") then resourcebundle is looked up as /org/openjump/myplugin/language/jump[_locale].properties categoryPrefixOrPath = new File("language/wfs/messages") then resourcebundle is looked up as /language/wfs/messages[_locale].properties- Parameters:
label- Label with argument insertion : {0}objects- values of parameters contained in the key- Returns:
- i18n label
-