|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.rad.util.TranslationMap
public class TranslationMap
Translation is for translating labels or label keys in any language. It supports wild card translation. This is supported in a very fast implementation. Translation examples: "Helo *, how are you?", "Hallo *, wie geht es Dir?" translates "Helo Lisa, how are you?" to "Hallo Lisa, wie geht es Dir?".
Constructor Summary | |
---|---|
TranslationMap()
Constructs a new translation map. |
Method Summary | |
---|---|
void |
clear()
Clears all translations. |
String |
get(String pText)
Gets the configured translation for the given text. |
Properties |
getAsProperties()
Gets this TranslationMap as Properties. |
String |
getLanguage()
Gets the language code of the translated texts. |
TranslationMap |
getParent()
Gets the Parent TranslationMap to delegate translations. |
List<String> |
getUntranslated()
Gets all the untranslated texts. |
Enumeration<String> |
keys()
Gets all translation map texts. |
long |
lastModified()
Gets the last modified time. |
String |
put(String pText,
String pTranslation)
Puts a new translation. |
void |
setAsProperties(Properties pProperties)
Sets this TranslationMap as Properties. |
void |
setLanguage(String pLanguage)
Sets the language code of the translated texts. |
void |
setParent(TranslationMap pParent)
Sets the Parent TranslationMap to delegate translations. |
int |
size()
The size of the translation map. |
String |
translate(String pText)
Translates the text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TranslationMap()
Method Detail |
---|
public TranslationMap getParent()
public void setParent(TranslationMap pParent)
pParent
- the Parent TranslationMap to delegate translations.
IllegalArgumentException
- if parent is not allowedpublic String translate(String pText)
pText
- the text to translate.
public String put(String pText, String pTranslation)
pText
- the text to translate.pTranslation
- the translation.
public Enumeration<String> keys()
public String get(String pText)
pText
- the text.
public int size()
public void clear()
public List<String> getUntranslated()
public Properties getAsProperties()
public void setAsProperties(Properties pProperties)
pProperties
- the Properties.public void setLanguage(String pLanguage)
pLanguage
- the language code e.g. "en"public String getLanguage()
public long lastModified()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |