Package org.hl7.fhir.utilities
Class TranslatorXml
- java.lang.Object
-
- org.hl7.fhir.utilities.TranslatorXml
-
- All Implemented Interfaces:
TranslationServices
public class TranslatorXml extends Object implements TranslationServices
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTranslatorXml.TranslatedTerm
-
Constructor Summary
Constructors Constructor Description TranslatorXml(String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>listTranslations(String category)get a list of translation codes by categoryStringtoStr(float value)localization for converting a decimal to language specific representationStringtoStr(Date value)localization for converting a date to language specific representationStringtranslate(String context, String value)equivalent to the general translation operation, but the context that provides the transations specifies the target languageStringtranslate(String context, String value, String targetLang)General translation functionality - given a string, translate it to a different languageStringtranslateAndFormat(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
-
-
-
Constructor Detail
-
TranslatorXml
public TranslatorXml(String filename) throws ParserConfigurationException, SAXException, IOException
-
-
Method Detail
-
translate
public String translate(String context, String value, String targetLang)
Description copied from interface:TranslationServicesGeneral translation functionality - given a string, translate it to a different language- Specified by:
translatein interfaceTranslationServices- Parameters:
context- - for debugging purposesvalue- - the string to translatetargetLang- - the target language to translate to.- Returns:
- the translated string, or value if no translation is found
-
translateAndFormat
public String translateAndFormat(String context, String lang, String value, Object... args)
Description copied from interface:TranslationServicesGeneral translation functionality - given a string, translate it to a different language, but also perform String.format on the outcome.- Specified by:
translateAndFormatin interfaceTranslationServices- Returns:
-
translate
public String translate(String context, String value)
Description copied from interface:TranslationServicesequivalent to the general translation operation, but the context that provides the transations specifies the target language- Specified by:
translatein interfaceTranslationServices- Returns:
-
toStr
public String toStr(float value)
Description copied from interface:TranslationServiceslocalization for converting a decimal to language specific representation- Specified by:
toStrin interfaceTranslationServices- Returns:
-
toStr
public String toStr(Date value)
Description copied from interface:TranslationServiceslocalization for converting a date to language specific representation- Specified by:
toStrin interfaceTranslationServices- Returns:
-
translations
public Map<String,String> translations(String value)
Description copied from interface:TranslationServicesGet a list of all translations available for a phrase- Specified by:
translationsin interfaceTranslationServices- Returns:
-
listTranslations
public Set<String> listTranslations(String category)
Description copied from interface:TranslationServicesget a list of translation codes by category- Specified by:
listTranslationsin interfaceTranslationServices- Returns:
-
-