diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java index 0f7233845..4017c9a20 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java @@ -13,46 +13,54 @@ import javax.servlet.ServletContext; import org.apache.log4j.Logger; /** - * + * * @author gleimar */ public class MyLabelLocatorGeneral implements org.zkoss.util.resource.LabelLocator { - private static Logger log = Logger.getLogger(MyLabelLocatorGeneral.class); - private ServletContext _svlctx; + private static Logger log = Logger.getLogger(MyLabelLocatorGeneral.class); + private ServletContext _svlctx; + private static final Locale localeEspanhol = new Locale("es"); - public MyLabelLocatorGeneral(ServletContext svlctx) { - if (svlctx == null) { - throw new IllegalArgumentException("null"); - } + public MyLabelLocatorGeneral(ServletContext svlctx) { + if (svlctx == null) { + throw new IllegalArgumentException("null"); + } - _svlctx = svlctx; - } + _svlctx = svlctx; + } - public URL locate(Locale locale) { - URL resource = null; - try { - resource =_svlctx.getResource("/WEB-INF/" + getI3LabelName(locale)); - if (resource == null){ - resource= _svlctx.getResource("/WEB-INF/" + getI3LabelDefault()); - } - } catch (MalformedURLException ex) { - log.error("Error al cargar locale:"+locale,ex); - try { - resource= _svlctx.getResource("/WEB-INF/" + getI3LabelDefault()); - } catch (MalformedURLException ex1) { - log.error("Error al cargar la traduccion estandard.",ex1); - throw new RuntimeException(ex1); - } - } - return resource; + public URL locate(Locale locale) { + URL resource = null; + try { + resource = _svlctx.getResource("/WEB-INF/" + getI3LabelName(locale)); + if (resource == null) { + resource = _svlctx.getResource("/WEB-INF/" + getI3LabelDefault()); + } + } catch (MalformedURLException ex) { + log.error("Error al cargar locale:" + locale, ex); + try { + resource = _svlctx.getResource("/WEB-INF/" + getI3LabelDefault()); + } catch (MalformedURLException ex1) { + log.error("Error al cargar la traduccion estandard.", ex1); + throw new RuntimeException(ex1); + } + } + return resource; - } + } + + private static final String getI3LabelName(Locale locale) { + + if ((locale != null) && (locale.getLanguage().equals(localeEspanhol.getLanguage()))) { + return "i3-label_es_MX.label"; + } + + return "i3-label_" + locale + ".label"; + } + + private static final String getI3LabelDefault() { + return "i3-label_pt_BR.label"; + } - private static final String getI3LabelName(Locale locale) { - return "i3-label_" + locale + ".label"; - } - private static final String getI3LabelDefault() { - return "i3-label_pt_BR.label"; - } } diff --git a/src/java/versionADM.info b/src/java/versionADM.info index 165105c33..daa71afd5 100644 --- a/src/java/versionADM.info +++ b/src/java/versionADM.info @@ -1 +1 @@ -ADM_20131002_1RC244 +ADM_20131003_1RC245