@@ -0,0 +1,1229 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public%0D%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0D%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0D%0Apackage fr.hhdev.ocelot;%0D%0A%0D%0Aimport fr.hhdev.ocelot.i18n.ThreadLocalContextHolder;%0D%0Aimport java.text.MessageFormat;%0D%0Aimport java.util.Locale;%0D%0Aimport java.util.ResourceBundle;%0D%0Aimport org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author hhfrancois%0D%0A */%0D%0Apublic class OcelotI18nServices %7B%0D%0A%09private static final Logger logger = LoggerFactory.getLogger(OcelotI18nServices.class);%0D%0A%09%0D%0A%09public Locale getUserLocale() %7B%0D%0A%09%09logger.debug(%22Get locale from OcelotServices%22);%0D%0A%09%09Locale locale = (Locale) ThreadLocalContextHolder.get(Constants.LOCALE);%0D%0A%09%09if(null==locale) %7B%0D%0A%09%09%09logger.debug(%22Get locale from OcelotServices : default%22);%0D%0A%09%09%09locale =  new Locale(%22en%22, %22US%22);%0D%0A%09%09%7D%0D%0A%09%09logger.debug(%22Get locale from OcelotServices : %7B%7D%22, locale);%0D%0A%09%09return locale;%0D%0A%09%09%0D%0A%09%7D%0D%0A%09%0D%0A%09public String getLocalizedMessage(String bundleName, String entry, Object%5B%5D args) %7B%0D%0A%09%09ResourceBundle bundle = ResourceBundle.getBundle(bundleName, getUserLocale());%0D%0A%09%09return MessageFormat.format(bundle.getString(entry), args);%0D%0A%09%7D%0D%0A%7D%0D%0A

Rename i18nServices