
Package org.hl7.fhir.r5.utils
Class Translations
java.lang.Object
org.hl7.fhir.r5.utils.Translations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(String id, String defaultMsg) use configured languagegetMessage(String id, String lang, String defaultMsg) return the message in a specified languagebooleanhasTranslation(String id) voidLoad from the XML translations file maintained by the FHIR projectvoidSet 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:
IOExceptionSAXExceptionFileNotFoundExceptionParserConfigurationExceptionException
-
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
-