i18n: Add support to Italian language in reports

Take advantage to simplify the code to calculate the locale

FEA: ItEr76S03Community
This commit is contained in:
Manuel Rego Casasnovas 2012-01-14 18:56:11 +01:00
parent 75682bb8fd
commit b5f7ef6841

View file

@ -32,7 +32,6 @@ import net.sf.jasperreports.engine.JRParameter;
import org.apache.commons.lang.StringUtils;
import org.libreplan.business.common.Registry;
import org.springframework.transaction.annotation.Transactional;
import org.zkoss.util.Locales;
import org.zkoss.zk.au.out.AuDownload;
import org.zkoss.zk.ui.Executions;
@ -64,9 +63,10 @@ public abstract class LibrePlanReportController extends GenericForwardComposer {
protected A URIlink;
private static Set<String> supportedLanguages = new HashSet<String>() {{
add("es");
add("en");
add("es");
add("gl");
add("it");
}};
private final String DEFAULT_LANG = "en";
@ -122,14 +122,7 @@ public abstract class LibrePlanReportController extends GenericForwardComposer {
}
private Locale getCurrentLocale() {
String lang = getLanguage();
if (lang.equals("es")) {
return new Locale("es", "ES");
}
if (lang.equals("gl")) {
return new Locale("gl", "ES");
}
return new Locale("en", "US");
return new Locale(getLanguage());
}
protected abstract JRDataSource getDataSource();