|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.localization.LocaleDetector
This class returns a Locale object based on the HTTP Accept-Language header. This class is based on examples from Jason Hunter's book Java Servlet Programming.
Constructor Summary | |
LocaleDetector()
Deprecated. |
Method Summary | |
static java.util.Locale |
getLocale(RunData data)
Deprecated. Attempts to pull the "Accept-Language" header out of the HttpServletRequest object and then parse it. |
static java.util.Locale |
getLocale(java.lang.String languageHeader)
Deprecated. This method parses the Accept-Language header and attempts to create a Locale out of it. |
private static java.util.Locale |
getLocaleForLanguage(java.lang.String language)
Deprecated. This method creates a Locale from the language. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public LocaleDetector()
Method Detail |
public static java.util.Locale getLocale(RunData data)
data
- Turbine information.public static java.util.Locale getLocale(java.lang.String languageHeader)
languageHeader
- A String with the language header.private static java.util.Locale getLocaleForLanguage(java.lang.String language)
language
- A String with the language.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |