gleimar 2013-10-03 14:51:34 +00:00
parent c5d5f91812
commit adc8def6d4
2 changed files with 42 additions and 34 deletions

View File

@ -20,6 +20,7 @@ public class MyLabelLocatorGeneral implements org.zkoss.util.resource.LabelLocat
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) {
@ -32,16 +33,16 @@ public class MyLabelLocatorGeneral implements org.zkoss.util.resource.LabelLocat
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());
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);
log.error("Error al cargar locale:" + locale, ex);
try {
resource= _svlctx.getResource("/WEB-INF/" + getI3LabelDefault());
resource = _svlctx.getResource("/WEB-INF/" + getI3LabelDefault());
} catch (MalformedURLException ex1) {
log.error("Error al cargar la traduccion estandard.",ex1);
log.error("Error al cargar la traduccion estandard.", ex1);
throw new RuntimeException(ex1);
}
}
@ -50,9 +51,16 @@ public class MyLabelLocatorGeneral implements org.zkoss.util.resource.LabelLocat
}
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";
}
}

View File

@ -1 +1 @@
ADM_20131002_1RC244
ADM_20131003_1RC245