java.lang.Objectorg.objectweb.telosys.common.TelosysObject
org.objectweb.telosys.uil.i18n.StandardTranslator
This class is the standard implementation of the Translator interface.
Constructor Summary | |
StandardTranslator()
The default constructor |
Method Summary | |
boolean |
isEmpty()
Returns true if this translator is empty ( contains no keys to translate ) |
void |
load(java.io.InputStream inputStream,
java.lang.String sLanguage)
Loads a language translation from a properties input stream |
int |
size()
Returns the dictionary size ( translator entries count ) |
java.lang.String |
translate(java.lang.String sKey,
java.lang.String sLanguage)
Returns the translated text for the given key and the given language |
Methods inherited from class org.objectweb.telosys.common.TelosysObject |
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardTranslator()
Method Detail |
public java.lang.String translate(java.lang.String sKey, java.lang.String sLanguage)
Translator
translate
in interface Translator
sKey
- the tag attribute key ( e.g. : "MyTagId.txt")sLanguage
- the language ( e.g. : "fr", "en", "it", ... )
public int size()
Translator
size
in interface Translator
public boolean isEmpty()
Translator
isEmpty
in interface Translator
public void load(java.io.InputStream inputStream, java.lang.String sLanguage)
inputStream
- : the properties input streamsLanguage
- : the language ISO code ( "fr", "en", .. )