public class I18nWorker.Library
extends java.lang.Object
Constructor and Description |
---|
Library() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
expandString(java.lang.String str)
Expands the supplied string.
|
java.util.List<java.lang.String> |
getTargetTMLanguages()
Returns the list of target languages as specified in the exported Translation Manager translation
data loaded by
loadTMTranslations() . |
void |
loadTMTranslations()
Loads Translation Manager translations data exported in CSV.
|
java.lang.String |
resolveTMTranslation(java.lang.String targetLanguage,
java.lang.String proc,
int line,
java.lang.String source)
Resolves the translation for the supplied target language, procedure and source message.
|
public void loadTMTranslations() throws java.io.IOException
tm-translations
configuration value, which holds comma separated list of CSV files with the exported translations.
All translations are kept in memory for subsequent calls of getTargetTMLanguages()
and
resolveTMTranslation(String, String, int, String)
.java.io.IOException
- For any IO error during reading the CSV files.public java.util.List<java.lang.String> getTargetTMLanguages()
loadTMTranslations()
.public java.lang.String resolveTMTranslation(java.lang.String targetLanguage, java.lang.String proc, int line, java.lang.String source)
loadTMTranslations()
. If the translation is
found it is returned by the method, otherwise the method returns null
.targetLanguage
- The target language.proc
- Path of the procedure which is the origin of the source message to translate.line
- The line of the source message in the specified procedure.source
- The source message to translate.public java.lang.String expandString(java.lang.String str)
TranslationManager
, for more details see
TranslationManager.getExpandedLength(String, double)
.str
- String to be expanded.