public class TranslatorXml extends Object implements TranslationServices
| Modifier and Type | Class and Description |
|---|---|
class |
TranslatorXml.TranslatedTerm |
| Constructor and Description |
|---|
TranslatorXml(String filename) |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
listTranslations(String category)
get a list of translation codes by category
|
String |
toStr(Date value)
localization for converting a date to language specific representation
|
String |
toStr(float value)
localization for converting a decimal to language specific representation
|
String |
translate(String context,
String value)
equivalent to the general translation operation, but the context that provides the transations specifies the target language
|
String |
translate(String context,
String value,
String targetLang)
General translation functionality - given a string, translate it to a different language
|
String |
translateAndFormat(String context,
String lang,
String value,
Object... args)
General translation functionality - given a string, translate it to a different language, but also perform String.format on the outcome.
|
Map<String,String> |
translations(String value)
Get a list of all translations available for a phrase
|
public TranslatorXml(String filename) throws ParserConfigurationException, SAXException, IOException
public String translate(String context, String value, String targetLang)
TranslationServicestranslate in interface TranslationServicescontext - - for debugging purposesvalue - - the string to translatetargetLang - - the target language to translate to.public String translateAndFormat(String context, String lang, String value, Object... args)
TranslationServicestranslateAndFormat in interface TranslationServicespublic String translate(String context, String value)
TranslationServicestranslate in interface TranslationServicespublic String toStr(float value)
TranslationServicestoStr in interface TranslationServicespublic String toStr(Date value)
TranslationServicestoStr in interface TranslationServicespublic Map<String,String> translations(String value)
TranslationServicestranslations in interface TranslationServicespublic Set<String> listTranslations(String category)
TranslationServiceslistTranslations in interface TranslationServicesCopyright © 2014–2019 University Health Network. All rights reserved.