Package org.hl7.fhir.dstu3.utils
Class Translations
java.lang.Object
org.hl7.fhir.dstu3.utils.Translations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMessage
(String id, String defaultMsg) use configured languagegetMessage
(String id, String lang, String defaultMsg) return the message in a specified languageboolean
hasTranslation
(String id) void
Load from the XML translations file maintained by the FHIR projectvoid
Set a default language to use
-
Constructor Details
-
Translations
public Translations()
-
-
Method Details
-
setLang
Set a default language to use- Parameters:
lang
-
-
load
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException Load from the XML translations file maintained by the FHIR project- Parameters:
filename
-- Throws:
IOException
SAXException
FileNotFoundException
ParserConfigurationException
Exception
-
hasTranslation
-
getMessage
use configured language- Parameters:
id
- - the id of the message to retrievedefaultMsg
- - string to use if the message is not defined or a language match is not found (if null, then will default to english)- Returns:
- the message
-
getMessage
return the message in a specified language- Parameters:
id
- - the id of the message to retrievelang
- - a language string from a browserdefaultMsg
- - string to use if the message is not defined or a language match is not found (if null, then will default to the english message)- Returns:
- the message
-
getLangDesc
-