org.apache.turbine.services.localization
Class LocaleDetector

java.lang.Object
  extended byorg.apache.turbine.services.localization.LocaleDetector

Deprecated. Use LocaleTokenizer instead.

public class LocaleDetector
extends java.lang.Object

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.

Version:
$Id: LocaleDetector.java 264148 2005-08-29 14:21:04Z henning $
Author:
Frank Y. Kim, Jon S. Stevens, Henning P. Schmiedehausen

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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleDetector

public LocaleDetector()
Deprecated. 
Method Detail

getLocale

public static java.util.Locale getLocale(RunData data)
Deprecated. 
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.
Returns:
A Locale.

getLocale

public 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.

Parameters:
languageHeader - A String with the language header.
Returns:
A Locale.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.