SchemaLocalizations { public String codelistValueLabel(GPathResult node) throws Exception { return codelistValueLabel(node.getProperty("@codeList").toString(), node.getProperty("@codeListValue").toString()); } SchemaLocalizations(ApplicationContext context, CurrentLanguageHolder languageHolder,
                               String schema, String extraSchemas); static SchemaLocalizations create(String schema); static SchemaLocalizations create(String schema, String lang3); String nodeLabel(GPathResult node); String nodeLabel(String qualifiedNodeName, String qualifiedParentNodeName); String nodeDesc(GPathResult node); String nodeDesc(String qualifiedNodeName, String qualifiedParentNodeName); String nodeTranslation(String qualifiedNodeName, String qualifiedParentNodeName, String type); String codelistValueLabel(GPathResult node); String codelistValueLabel(String codelist, String value); String codelistValueDesc(GPathResult node); String codelistValueDesc(String codelist, String value); String codelistTranslation(String codelist, String context, String type); String translateLanguageCode(String value); Collection<String> codelist(String codelistName); String schemaString(String... key); static final String LANG_CODELIST_NS; }
@Test public void testLangCodeTranslations() throws Exception { assertEquals("English", localizations.codelistValueLabel(LANG_CODELIST_NS, "eng")); assertEquals("English", localizations.codelistValueLabel(LANG_CODELIST_NS, "en")); assertEquals("German", localizations.codelistValueLabel(LANG_CODELIST_NS, "ger")); assertEquals("German", localizations.codelistValueLabel(LANG_CODELIST_NS, "de")); assertEquals("German", localizations.codelistValueLabel(LANG_CODELIST_NS, "deu")); assertEquals("xyz", localizations.codelistValueLabel(LANG_CODELIST_NS, "xyz")); assertEquals("dd", localizations.codelistValueLabel(LANG_CODELIST_NS, "dd")); assertEquals(null, localizations.codelistValueLabel(LANG_CODELIST_NS, null)); }