|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.localization.Localization
Wrapper around the TurbineLocalization Service that makes it easy to grab something from the service and make the code cleaner.
Instead of typing:
((LocalizationService)TurbineServices.getInstance()
.getService(LocalizationService.SERVICE_NAME))
.getBundle(data)
.getString(str)
Now you only need to type:
Localization.getString(str)
Constructor Summary | |
Localization()
|
Method Summary | |
static java.util.ResourceBundle |
getBundle(java.lang.String bundleName)
Convenience method to get a ResourceBundle based on name. |
static java.util.ResourceBundle |
getBundle(java.lang.String bundleName,
java.util.Locale locale)
Convenience method to get a ResourceBundle based on name and Locale. |
static java.util.ResourceBundle |
getBundle(java.lang.String bundleName,
RunData data)
Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header in RunData. |
static java.util.ResourceBundle |
getBundle(java.lang.String bundleName,
java.lang.String languageHeader)
Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header. |
static java.lang.String |
getString(RunData data,
java.lang.String str)
Pulls a string out of the LocalizationService and attempts to determine the Locale by the Accept-Language header. |
static java.lang.String |
getString(java.lang.String str)
Pulls a string out of the LocalizationService with the default locale values of what is defined in the TurbineResources.properties file for the locale.default.language and locale.default.country property values. |
static java.lang.String |
getString(java.lang.String str,
java.lang.String lang)
Convenience method that pulls a localized string off the LocalizationService using the default ResourceBundle name defined in the TurbineResources.properties file and the specified language name in ISO format. |
static void |
setBundle(java.lang.String defaultBundle)
This method sets the name of the defaultBundle. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Localization()
Method Detail |
public static java.lang.String getString(java.lang.String str)
str
- Name of string.public static java.lang.String getString(RunData data, java.lang.String str)
data
- Turbine information.str
- Name of string.public static java.lang.String getString(java.lang.String str, java.lang.String lang)
str
- Name of string.lang
- Desired language for the localized string.public static java.util.ResourceBundle getBundle(java.lang.String bundleName)
bundleName
- Name of bundle.public static java.util.ResourceBundle getBundle(java.lang.String bundleName, java.lang.String languageHeader)
bundleName
- Name of bundle.languageHeader
- A String with the language header.public static java.util.ResourceBundle getBundle(java.lang.String bundleName, RunData data)
bundleName
- Name of bundle.data
- Turbine information.public static java.util.ResourceBundle getBundle(java.lang.String bundleName, java.util.Locale locale)
bundleName
- Name of bundle.locale
- A Locale.public static void setBundle(java.lang.String defaultBundle)
defaultBundle
- Name of default bundle.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |