Functions extends SchemaLocalizations { public String translate(String key) throws Exception { return translate(key, null); } Functions(FormatterParams fparams, Environment env); String html(Closure htmlFunction); String translate(String key); String translate(String key, String file); SchemaPlugin getSchemaPlugin(); String getXPathFrom(GPathResult path);  }
@Test public void testTranslate() throws Exception { assertEquals("FormatterStrings", functions.translate("formatter-strings")); final String inBoth = functions.translate("in-both"); assertTrue(inBoth, inBoth.equals("In Both strings") || inBoth.equals("In Both other-strings")); assertEquals("In Both other-strings", functions.translate("in-both", "other-strings")); assertEquals("In Both strings", functions.translate("in-both", "strings")); assertEquals("Schema Normal Strings XML", functions.translate("schema-strings")); assertEquals("Parent Schema Normal Strings XML", functions.translate("parent-schema-strings")); assertEquals("Parent Schema More Strings XML", functions.translate("parent-schema-more")); final String inBothParent = functions.translate("in-both-parent"); assertTrue(inBothParent.equals("In Both Parent Strings XML") || inBothParent.equals("In Both Parent More Strings XML")); assertEquals("In Both Parent Strings XML", functions.translate("in-both-parent", "strings")); assertEquals("In Both Parent More Strings XML", functions.translate("in-both-parent", "more-strings")); assertEquals("This String is here for testing don't delete", functions.translate("testString")); }