Using I18N inside a Transformer class
I'm trying to translate text inside a Transformer class. The page's locale is coming out at de but I'm never getting the German string. My i18n libraries are correct because I can get the translated string out via the groovy console. Any idea why the resourceBundle isn't loading the translations?
... class TranslationTransformer extends AbstractSAXPipe implements Transformer { ... @Override public void init(final ProcessingContext context, final ProcessingComponentConfiguration config) throws IOException { this.request = context.request Page page = this.request.resource.parent.adaptTo(Page.class) if (page) { Locale locale = page.getLanguage(false) ResourceBundle resourceBundle = this.request.getResourceBundle(locale) this.i18n = new I18n(resourceBundle) LOG.debug("... Locale is $locale") String temp = "Contact Us" String output = i18n.getVar(temp) LOG.debug("... Contact Us is $output") } } ... }