Fix i18n formatting problem on dashboards

On the chinese translation of the dashboard a formatting exception was being raised
due to the way the i18n methods were being called.

FEA: ItEr77S04BugFixing
This commit is contained in:
Lorenzo Tilve Álvaro 2013-03-25 13:35:33 +01:00
parent 0cb2fb890f
commit d55b5d4801
5 changed files with 14 additions and 16 deletions

View file

@ -26,6 +26,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@ -161,10 +162,10 @@ public class DashboardController extends GenericForwardComposer {
if ((lblAbsolute != null) && (absoluteMargin != null)) {
lblAbsolute
.setValue(String
.format(_("There is a margin of %d days with the project global deadline (%.2f %%)."),
absoluteMargin + 0,
relativeMargin.doubleValue() * 100));
.setValue(_(
"There is a margin of {0} days with the project global deadline ({1}%).",
absoluteMargin, (new DecimalFormat("#.##"))
.format(relativeMargin.doubleValue() * 100)));
} else {
lblAbsolute.setValue(_("No project deadline defined"));
}

View file

@ -5395,10 +5395,8 @@ msgid "Progress Evolution"
msgstr "Evolución del progreso"
#: libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java:165
msgid ""
"There is a margin of %d days with the project global deadline (%.2f %%)."
msgstr ""
"Hay un margen de %d días con la fecha límite global del proyecto (%.2f %%)."
msgid "There is a margin of {0} days with the project global deadline ({1}%)."
msgstr "Hay un margen de {0} días con la fecha límite global del proyecto ({1}%)."
#: libreplan-webapp/src/main/webapp/planner/taskpanels/_tabPanelNonLimitingResourceAllocation.zul:91
msgid "Original"

View file

@ -5156,9 +5156,8 @@ msgid ""
msgstr "Os valores de subcontratación son de só lectura porque foron notificados pola empresa subcontratista."
#: libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java:165
msgid ""
"There is a margin of %d days with the project global deadline (%.2f %%)."
msgstr "Hai unha marxe de %d días coa data límite global do proxecto (%.2f %%)."
msgid "There is a margin of {0} days with the project global deadline ({1}%)."
msgstr "Hai unha marxe de {0} días coa data límite global do proxecto ({1}%)."
#: libreplan-webapp/src/main/java/org/libreplan/web/planner/chart/EarnedValueChartFiller.java:250
msgid "CV"

View file

@ -5203,7 +5203,7 @@ msgstr ""
#: libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java:165
msgid ""
"There is a margin of %d days with the project global deadline (%.2f %%)."
"There is a margin of {0} days with the project global deadline ({1}%)."
msgstr ""
#: libreplan-webapp/src/main/webapp/planner/taskpanels/_tabPanelNonLimitingResourceAllocation.zul:91

View file

@ -1,4 +1,4 @@
# LibrePlan - Webapp module.
# LibrePlae - Webapp module.
# Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
# Desenvolvemento Tecnolóxico de Galicia
# Copyright (C) 2010-2012 Igalia, S.L.
@ -72,7 +72,7 @@ msgid "Create Virtual Worker"
msgstr "创建虚拟工作人员"
#: libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportCRUDController.java:862
#: libreplan-webapp/src/main/java/org/libreplan/web/tree/TreeComponent.java:105
#: libreplan-webapp/src/main/java/org/libreplan/web/tree/TreeComponent.java:104
#: libreplan-webapp/src/main/webapp/labels/_editLabelType.zul:81
#: libreplan-webapp/src/main/webapp/labels/_listLabelTypes.zul:28
#: libreplan-webapp/src/main/webapp/advance/_listAdvanceTypes.zul:30
@ -5156,8 +5156,8 @@ msgstr "阅读不仅是因为他们的报告由分包商公司的分包商值。
#: libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java:165
msgid ""
"There is a margin of %d days with the project global deadline (%.2f %%)."
msgstr "总项目的截止日期(%.2f %%)前有%d天的余量。"
"There is a margin of {0} days with the project global deadline ({1}%)."
msgstr "总项目的截止日期({1}%)前有{0}天的余量。"
#: libreplan-webapp/src/main/java/org/libreplan/web/planner/chart/EarnedValueChartFiller.java:250
msgid "CV"