|
||||||||||
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. |
java.lang.String |
get(java.lang.String pText)
Gets the configured translation for the given text. |
java.util.Properties |
getAsProperties()
Gets this TranslationMap as Properties. |
java.lang.String |
getLanguage()
Gets the language code of the translated texts. |
TranslationMap |
getParent()
Gets the Parent TranslationMap to delegate translations. |
java.lang.String |
getResourcePath()
Gets the resource path. |
java.util.List<java.lang.String> |
getUntranslated()
Gets all the untranslated texts. |
java.util.Enumeration<java.lang.String> |
keys()
Gets all translation map texts. |
long |
lastModified()
Gets the last modified time. |
java.lang.String |
put(java.lang.String pText,
java.lang.String pTranslation)
Puts a new translation. |
void |
setAsProperties(java.util.Properties pProperties)
Sets this TranslationMap as Properties. |
void |
setLanguage(java.lang.String pLanguage)
Sets the language code of the translated texts. |
void |
setParent(TranslationMap pParent)
Sets the Parent TranslationMap to delegate translations. |
void |
setResourcePath(java.lang.String pPath)
Sets the resource path as additional information, if known. |
int |
size()
The size of the translation map. |
java.lang.String |
translate(java.lang.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.
java.lang.IllegalArgumentException
- if parent is not allowedpublic java.lang.String translate(java.lang.String pText)
translate
in interface ITranslator
pText
- the text to translate.
public java.lang.String put(java.lang.String pText, java.lang.String pTranslation)
pText
- the text to translate.pTranslation
- the translation.
public java.util.Enumeration<java.lang.String> keys()
public java.lang.String get(java.lang.String pText)
pText
- the text.
public int size()
public void clear()
public java.util.List<java.lang.String> getUntranslated()
public java.util.Properties getAsProperties()
public void setAsProperties(java.util.Properties pProperties)
pProperties
- the Properties.public void setLanguage(java.lang.String pLanguage)
pLanguage
- the language code e.g. "en"public java.lang.String getLanguage()
public void setResourcePath(java.lang.String pPath)
pPath
- the resource that contains the translationpublic java.lang.String getResourcePath()
null
if path is not knownpublic long lastModified()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |