net.xoetrope.xui.helper
Class XDefaultTranslator

java.lang.Object
  extended by net.xoetrope.xui.helper.XDefaultTranslator
All Implemented Interfaces:
XTranslator

public class XDefaultTranslator
extends java.lang.Object
implements XTranslator


Field Summary
protected  java.util.ResourceBundle languageResourceBundle
           
 
Constructor Summary
XDefaultTranslator()
          Creates a new instance of XDefaultTranslator
 
Method Summary
 void setResourceBundle(java.util.ResourceBundle bundle)
          Set the resource bundle for this translator
 java.lang.String translate(java.lang.String key)
          Look up the translation of a key using the current language resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

languageResourceBundle

protected java.util.ResourceBundle languageResourceBundle
Constructor Detail

XDefaultTranslator

public XDefaultTranslator()
Creates a new instance of XDefaultTranslator

Method Detail

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle bundle)
Set the resource bundle for this translator

Specified by:
setResourceBundle in interface XTranslator
Parameters:
bundle - the translation resource bundle

translate

public java.lang.String translate(java.lang.String key)
Look up the translation of a key using the current language resource. If the translation is not found the key value is returned.

Specified by:
translate in interface XTranslator
Parameters:
key - the key string
Returns:
the translation