final String i18nPrefix = TemplateUtil.getI18nPrefix(templateFileName); final URL resource = TranslationServiceGenerator.class.getClassLoader().getResource(templateFileName); if (resource == null) {
final String i18nPrefix = TemplateUtil.getI18nPrefix(templateFileName); final URL resource = TranslationServiceGenerator.class.getClassLoader().getResource(templateFileName); if (resource == null) {
/** * Called to perform i18n translation on the given template. Add i18n-prefix attribute to root of * template to allow translation after bean creation. * * @param templateRoot */ public static void translateTemplate(final String templateFile, final Element templateRoot) { if (!getTranslationService().isEnabled()) return; logger.finer("Translating template: " + templateFile); final String i18nKeyPrefix = getI18nPrefix(templateFile); // Add i18n prefix attribute for post-creation translation templateRoot.setAttribute("data-i18n-prefix", i18nKeyPrefix); DomVisit.visit(new ElementWrapper(templateRoot), new TemplateTranslationVisitor(i18nKeyPrefix)); }
/** * Called to perform i18n translation on the given template. Add i18n-prefix attribute to root of * template to allow translation after bean creation. * * @param templateRoot */ public static void translateTemplate(final String templateFile, final Element templateRoot) { if (!getTranslationService().isEnabled()) return; logger.finer("Translating template: " + templateFile); final String i18nKeyPrefix = getI18nPrefix(templateFile); // Add i18n prefix attribute for post-creation translation templateRoot.setAttribute("data-i18n-prefix", i18nKeyPrefix); DomVisit.visit(new ElementWrapper(templateRoot), new TemplateTranslationVisitor(i18nKeyPrefix)); }