public class Translations extends Object
| Constructor and Description |
|---|
Translations() |
| Modifier and Type | Method and Description |
|---|---|
String |
getLangDesc(String s) |
String |
getMessage(String id,
String defaultMsg)
use configured language
|
String |
getMessage(String id,
String lang,
String defaultMsg)
return the message in a specified language
|
boolean |
hasTranslation(String id) |
void |
load(String filename)
Load from the XML translations file maintained by the FHIR project
|
void |
setLang(String lang)
Set a default language to use
|
public Translations()
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException
filename - IOExceptionSAXExceptionFileNotFoundExceptionParserConfigurationExceptionExceptionpublic boolean hasTranslation(String id)
public String getMessage(String id, String defaultMsg)
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)public String getMessage(String id, String lang, String defaultMsg)
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)public String getLangDesc(String s)
Copyright © 2014–2021 Health Level 7. All rights reserved.