Package org.apache.fulcrum.localization
Interface LocalizationService
- All Superinterfaces:
- SimpleLocalizationService
- All Known Implementing Classes:
- DefaultLocalizationService
 Provides localization functionality using the interface provided
 by ResourceBundle, plus leverages a "search path"
 style traversal of the ResourceBundle objects named by
 the locale.default.bundles to discover a value for a
 given key.
 
 It is suggested that one handle
 dealing with concatenated messages
 using MessageFormat and properties files.
 
- Version:
- $Id$
- Author:
- Jon S. Stevens, Daniel Rall, Leonard Richardson, Stephen McConnell, Thomas Vandahl
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptiongetBundle(jakarta.servlet.http.HttpServletRequest req) Convenience method to get a ResourceBundle based on HTTP Accept-Language header in HttpServletRequest.Convenience method to get aResourceBundlebased on name and HTTPAccept-Languageheader from aHttpServletRequest.Convenience method to get a ResourceBundle based on name and HTTPAccept-Languageheader.getLocale(jakarta.servlet.http.HttpServletRequest req) Attempts to pull theAccept-Languageheader out of theHttpServletRequestobject and then parse it.Parses theAccept-Languageheader and attempts to create aLocalefrom it.Methods inherited from interface org.apache.fulcrum.localization.SimpleLocalizationServiceformat, format, format, getBundle, getBundle, getBundle, getBundleNames, getDefaultBundleName, getDefaultCountry, getDefaultLanguage, getDefaultLocale, getString, getString, setBundle
- 
Field Details- 
ROLE
- 
SERVICE_NAME
- 
ACCEPT_LANGUAGEA constant for the HTTPAccept-Languageheader.- See Also:
 
 
- 
- 
Method Details- 
getBundleConvenience method to get a ResourceBundle based on name and HTTPAccept-Languageheader.- Parameters:
- bundleName- Name of bundle.
- languageHeader- A String with the language header.
- Returns:
- A localized ResourceBundle.
 
- 
getBundleConvenience method to get a ResourceBundle based on HTTP Accept-Language header in HttpServletRequest.- Parameters:
- req- The HTTP request to parse the- Accept-Languageof.
- Returns:
- A localized ResourceBundle.
 
- 
getBundleConvenience method to get aResourceBundlebased on name and HTTPAccept-Languageheader from aHttpServletRequest.- Parameters:
- bundleName- Name of bundle.
- req- The HTTP request to parse the- Accept-Languageof.
- Returns:
- A localized ResourceBundle.
 
- 
getLocaleAttempts to pull theAccept-Languageheader out of theHttpServletRequestobject and then parse it. If the header is not present, it will return anullLocale.- Parameters:
- req- The HTTP request to parse the- Accept-Languageof.
- Returns:
- The parsed locale.
 
- 
getLocaleParses theAccept-Languageheader and attempts to create aLocalefrom it.- Parameters:
- languageHeader- The language header (i.e.- en, es;q=0.8, zh-TW;q=0.1), or- nullfor the locale corresponding to the default language and country.
- Returns:
- The parsed locale, or a locale corresponding to the language and country defaults.
 
 
-