| |
|
| java.lang.Object org.apache.turbine.services.localization.LocaleDetector
LocaleDetector | public class LocaleDetector (Code) | | 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.
author: Frank Y. Kim author: Jon S. Stevens author: Henning P. Schmiedehausen version: $Id: LocaleDetector.java 534527 2007-05-02 16:10:59Z tv $ |
Method Summary | |
public static Locale | getLocale(RunData data) Attempts to pull the "Accept-Language" header out of the
HttpServletRequest object and then parse it. | public static Locale | getLocale(String languageHeader) This method parses the Accept-Language header and attempts to
create a Locale out of it.
Parameters: languageHeader - A String with the language header. |
getLocale | public static Locale getLocale(RunData data)(Code) | | Attempts to pull the "Accept-Language" header out of the
HttpServletRequest object and then parse it. If the header is
not present, it will return a null Locale.
Parameters: data - Turbine information. A Locale. |
getLocale | public static Locale getLocale(String languageHeader)(Code) | | This method parses the Accept-Language header and attempts to
create a Locale out of it.
Parameters: languageHeader - A String with the language header. A Locale. |
|
|
|