org.apache.jetspeed.services.customlocalization
Class CustomLocalizationTool

java.lang.Object
  extended byorg.apache.jetspeed.services.customlocalization.CustomLocalizationTool
All Implemented Interfaces:
org.apache.turbine.services.pull.ApplicationTool

public class CustomLocalizationTool
extends java.lang.Object
implements org.apache.turbine.services.pull.ApplicationTool

Custom localization tool.

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

Field Summary
protected  java.util.Locale locale
           
 
Constructor Summary
CustomLocalizationTool()
           
 
Method Summary
 java.lang.String get(java.lang.String key)
           
 java.lang.String get(java.lang.String key, java.util.Locale locale)
          Gets localized key from the default bundle and the provided locale.
protected  java.lang.String getBundleName(java.lang.Object data)
           
 java.util.Locale getLocale()
           
 void init(java.lang.Object data)
           
 void refresh()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locale

protected java.util.Locale locale
Constructor Detail

CustomLocalizationTool

public CustomLocalizationTool()
Method Detail

get

public java.lang.String get(java.lang.String key)

get

public java.lang.String get(java.lang.String key,
                            java.util.Locale locale)
Gets localized key from the default bundle and the provided locale. Returns null if the resource is missing.

Parameters:
key - string to translate.
locale - prefered locale for translation.
Returns:
localized key.

getLocale

public java.util.Locale getLocale()

getBundleName

protected java.lang.String getBundleName(java.lang.Object data)

init

public final void init(java.lang.Object data)
Specified by:
init in interface org.apache.turbine.services.pull.ApplicationTool

refresh

public void refresh()
Specified by:
refresh in interface org.apache.turbine.services.pull.ApplicationTool


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