[Bug #819] Report internazionalization problem in webkit browsers
Need to explicitely set Locale with language and country as the currentLocale only has information about language but not country FEA: ItEr70S04BugFixing
This commit is contained in:
parent
ec404f11b0
commit
b5abd65b29
1 changed files with 14 additions and 0 deletions
|
|
@ -23,10 +23,12 @@ package org.navalplanner.web.reports;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sf.jasperreports.engine.JRDataSource;
|
||||
import net.sf.jasperreports.engine.JRParameter;
|
||||
|
||||
import org.navalplanner.web.common.components.ExtendedJasperreport;
|
||||
import org.zkoss.util.Locales;
|
||||
|
|
@ -86,6 +88,7 @@ public abstract class NavalplannerReportController extends GenericForwardCompose
|
|||
protected Map<String, Object> getParameters() {
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
parameters.put("logo", String.format("/logos/%s/logo.png", getLanguage()));
|
||||
parameters.put(JRParameter.REPORT_LOCALE, getCurrentLocale());
|
||||
return parameters;
|
||||
}
|
||||
|
||||
|
|
@ -97,6 +100,17 @@ public abstract class NavalplannerReportController extends GenericForwardCompose
|
|||
return lang;
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
protected abstract JRDataSource getDataSource();
|
||||
|
||||
protected abstract String getReportName();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue