Package com.groiss.component
Class Resource
java.lang.Object
com.groiss.component.Resource
- All Implemented Interfaces:
Serializable
Provides resource strings in several languages.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateLocalizedList
(String... args) getErrorMessage
(String key) getErrorMessage
(String key, Object... arguments) getErrorMessage
(String key, Locale l) protected ResourceBundle
getResourceBundle
(Locale l, String bundleName) loadAndLocalizeResource
(String resource) loadAndLocalizeResource
(String resource, boolean couldBeMobile) loadAndLocalizeResource
(String resource, Locale l) loadAndLocalizeResource
(String resource, Locale l, boolean couldBeMobile) Localize a string containing keys in following syntax: @@@key@@.void
setDefaultLocale
(Locale newDefault) toString()
-
Field Details
-
HEX_SINGLEQUOTES
js-files may have problems if i18n-strings contain singlequotes. use hex-value instead; set this property viaThreadContext.setAttribute(Object, Object)
to turn this feature on don't forget to remove the attribute viaThreadContext.removeAttribute(Object)
in a finally{} block- See Also:
-
resname
-
errname
-
defaultLocale
-
-
Constructor Details
-
Resource
-
Resource
-
-
Method Details
-
getString
-
getString
-
getString
-
getErrorMessage
-
getErrorMessage
-
getErrorMessage
-
loadAndLocalizeResource
-
loadAndLocalizeResource
-
loadAndLocalizeResource
-
loadAndLocalizeResource
- Parameters:
resource
-l
-couldBeMobile
- when set to true try to load mobile resource first- Returns:
-
localize
Localize a string containing keys in following syntax: @@@key@@. If you want to have @@@ not replaceed write @@@@.- Parameters:
resource
- the string to localizel
- the used locale- Returns:
- the localized string
-
getDefaultLocale
-
setDefaultLocale
-
getErrorsName
-
getStringsName
-
getResourceBundle
-
createLocalizedList
-
toString
-