Modifier | Constructor and Description |
---|---|
protected |
Translation(String key)
Creates a new translation, containing all native language values for the given key.
|
Modifier and Type | Method and Description |
---|---|
void |
addTranslation(String lang,
String value,
boolean silent)
Adds a translation for the given language.
|
protected boolean |
containsText(String effectiveFilter)
Checks if the given filter is either contained in the key or in one of the translations
|
String |
getFile()
Returns the name of the file in which the property is defined.
|
String |
getKey()
Returns the key for which the translation can be found
|
boolean |
hasTranslation(String lang)
Determines if a translation for the given language is available
|
boolean |
isAccessed()
Determines whether the translation was already accessed
|
boolean |
isAutocreated()
Returns true if the translation was auto created as it was missing in the .properties files.
|
protected void |
setAutocreated(boolean autocreated)
Sets the the autocreated flag.
|
protected void |
setFile(String file)
Sets the name of the file in which the property is defined.
|
String |
translate(String lang)
Returns the translation for the given language
|
String |
translateWithoutFallback(String lang)
Returns the translation for the given language
|
protected void |
writeTo(Map<String,sirius.kernel.nls.SortedProperties> propMap)
Writes all translations into the given map
|
protected Translation(String key)
key
- the key for which the translations are heldpublic boolean isAutocreated()
protected void setAutocreated(boolean autocreated)
autocreated
- determines if the translation was automatically created by the system (true).protected void setFile(String file)
file
- the name of the file in which the property is definedpublic String getFile()
public void addTranslation(String lang, String value, boolean silent)
lang
- a two-letter language code for which the given translation should be usedvalue
- the translation for the given languagesilent
- determines if a warning is issued if an existing translation is overridden. Setting
silent to true will prevent such warnings and is used to load customer specific
translations which purpose is ti override existing translations.public String getKey()
public boolean isAccessed()
public String translate(String lang)
lang
- the language as two-letter codepublic String translateWithoutFallback(String lang)
lang
- the language as two-letter codepublic boolean hasTranslation(String lang)
lang
- the language as two-letter codeprotected boolean containsText(String effectiveFilter)
effectiveFilter
- the filter to be applied. null indicates that no filtering should take placeCopyright © 2018. All rights reserved.