Package org.hl7.fhir.r4.utils
Class Translations
- java.lang.Object
-
- org.hl7.fhir.r4.utils.Translations
-
public class Translations extends Object
-
-
Constructor Summary
Constructors Constructor Description Translations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLangDesc(String s)StringgetMessage(String id, String defaultMsg)use configured languageStringgetMessage(String id, String lang, String defaultMsg)return the message in a specified languagebooleanhasTranslation(String id)voidload(String filename)Load from the XML translations file maintained by the FHIR projectvoidsetLang(String lang)Set a default language to use
-
-
-
Constructor Detail
-
Translations
public Translations()
-
-
Method Detail
-
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
public boolean hasTranslation(String id)
-
getMessage
public String getMessage(String id, String defaultMsg)
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
public String getMessage(String id, String lang, String defaultMsg)
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
public String getLangDesc(String s)
-
-