public class Resource extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected Locale |
defaultLocale |
protected String |
errname |
static String |
HEX_SINGLEQUOTES
js-files may have problems if i18n-strings contain singlequotes.
|
protected String |
resname |
Constructor and Description |
---|
Resource(String strings,
String errors) |
Resource(String strings,
String errors,
Locale l) |
Modifier and Type | Method and Description |
---|---|
List<String> |
createLocalizedList(String... args) |
Locale |
getDefaultLocale() |
String |
getErrorMessage(String key) |
String |
getErrorMessage(String key,
Locale l) |
String |
getErrorMessage(String key,
Object... arguments) |
String |
getErrorsName() |
protected ResourceBundle |
getResourceBundle(Locale l,
String bundleName) |
String |
getString(String key) |
String |
getString(String key,
Locale l) |
String |
getString(String key,
Object... arguments) |
String |
getStringsName() |
String |
loadAndLocalizeResource(String resource) |
String |
loadAndLocalizeResource(String resource,
boolean couldBeMobile) |
String |
loadAndLocalizeResource(String resource,
Locale l) |
String |
loadAndLocalizeResource(String resource,
Locale l,
boolean couldBeMobile) |
String |
localize(String resource,
Locale l)
Localize a string containing keys in following syntax: @@@key@@.
|
void |
setDefaultLocale(Locale newDefault) |
String |
toString() |
public static final String HEX_SINGLEQUOTES
ThreadContext.setAttribute(Object, Object)
to turn this feature on
don't forget to remove the attribute via ThreadContext.removeAttribute(Object)
in a finally{} blockprotected String resname
protected String errname
protected Locale defaultLocale
public String loadAndLocalizeResource(String resource, boolean couldBeMobile)
public String loadAndLocalizeResource(String resource, Locale l, boolean couldBeMobile)
resource
- l
- couldBeMobile
- when set to true try to load mobile resource firstpublic String localize(String resource, Locale l)
resource
- the string to localizel
- the used localepublic Locale getDefaultLocale()
public void setDefaultLocale(Locale newDefault)
public String getErrorsName()
public String getStringsName()
protected ResourceBundle getResourceBundle(Locale l, String bundleName)
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.