org.apache.jetspeed.services.customlocalization
Class JetspeedLocalizationService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.turbine.services.localization.TurbineLocalizationService
                  extended byorg.apache.jetspeed.services.customlocalization.JetspeedLocalizationService
All Implemented Interfaces:
CustomLocalizationService, org.apache.turbine.services.Initable, org.apache.turbine.services.localization.LocalizationService, org.apache.turbine.services.Service

public class JetspeedLocalizationService
extends org.apache.turbine.services.localization.TurbineLocalizationService
implements CustomLocalizationService

This class is the single point of access to all localization resources. It caches different ResourceBundles for different Locales.

Work in the same way of turbine except for getLocale(RunData data), turbine read the accept-language header in a http request, instead this method read the user.getPerm("language") from the RunData to obtain the language choice by the user without the browser language rule. If a user not change the language with a ChangeLanguagePortlet, and a user.getPerm("language")are not set, the "Accept-Language" header are read.

Version:
$Id: JetspeedLocalizationService.java,v 1.9 2005/03/21 18:21:43 sgala Exp $
Author:
Dessė Massimiliano

Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.services.customlocalization.CustomLocalizationService
ACCEPT_LANGUAGE, SERVICE_NAME
 
Constructor Summary
JetspeedLocalizationService()
           
 
Method Summary
 java.util.Locale getLocale(org.apache.turbine.util.RunData data)
          This method read if a user has set getPerm("language") to use another language or not.
 
Methods inherited from class org.apache.turbine.services.localization.TurbineLocalizationService
getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getDefaultBundleName, getLocale, getLocale, getString, getStringOrNull, init, initBundleNames, setBundle
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.services.customlocalization.CustomLocalizationService
getBundle
 
Methods inherited from interface org.apache.turbine.services.localization.LocalizationService
getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getDefaultBundleName, getLocale, getLocale, getString, setBundle
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Constructor Detail

JetspeedLocalizationService

public JetspeedLocalizationService()
Method Detail

getLocale

public final java.util.Locale getLocale(org.apache.turbine.util.RunData data)
This method read if a user has set getPerm("language") to use another language or not. If not set , accept-language of the request are returned.

Specified by:
getLocale in interface CustomLocalizationService
Parameters:
data -
Returns:


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