@Override public void setLocale(Locale locale) { super.setLocale(locale); this.locale = locale; this.i18NSource = I18NSourceFactory.createI18NSource(locale); }
public void registerI18NProvider(I18NProvider i18Provider, String providerId) { I18N_PROVIDER_REGISTRY.put(providerId, i18Provider); I18NSourceFactory.invalidateCache(); logger.warning("Registered I18NProvider: " + providerId); }
current.set(this); I18NSource.ThreadUtil.setThreadI18nSource(I18NSourceFactory.createI18NSource(request.getLocale()));
public void unregisterI18NProvider(String providerId) { I18N_PROVIDER_REGISTRY.remove(providerId); I18NSourceFactory.invalidateCache(); logger.warning("Unregistered I18NProvider: " + providerId); }
@Override protected void writeAjaxPageHtmlVaadinScripts(RenderRequest request, RenderResponse response, BufferedWriter writer, Application application, String themeName) throws IOException, PortletException { response.createResourceURL().setParameter("img", "loader"); this.application = application; I18NSource i18NSource = I18NSourceFactory.createI18NSource(request.getLocale()); writer.write(String.format("<div name='%s'>%s</div>", getLoaderTagId(request.getWindowID(), getPortletConfig()), i18NSource.getMessage("loader.message"))); super.writeAjaxPageHtmlVaadinScripts(request, response, writer, application, themeName); } @Override
I18NSource messageSource = i18NSourceFactory.createI18NSource(locale); processToolContext.setMessageSource(messageSource);