From d55b5d4801bf9d3e813039edd8a5c8be7ca8b318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Tilve=20=C3=81lvaro?= Date: Mon, 25 Mar 2013 13:35:33 +0100 Subject: [PATCH] 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 --- .../org/libreplan/web/dashboard/DashboardController.java | 9 +++++---- libreplan-webapp/src/main/resources/i18n/es.po | 6 ++---- libreplan-webapp/src/main/resources/i18n/gl.po | 5 ++--- libreplan-webapp/src/main/resources/i18n/keys.pot | 2 +- libreplan-webapp/src/main/resources/i18n/zh.po | 8 ++++---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java b/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java index c1c138c0a..a611459d0 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/dashboard/DashboardController.java @@ -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")); } diff --git a/libreplan-webapp/src/main/resources/i18n/es.po b/libreplan-webapp/src/main/resources/i18n/es.po index d205e97d3..f8b98c7fe 100644 --- a/libreplan-webapp/src/main/resources/i18n/es.po +++ b/libreplan-webapp/src/main/resources/i18n/es.po @@ -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" diff --git a/libreplan-webapp/src/main/resources/i18n/gl.po b/libreplan-webapp/src/main/resources/i18n/gl.po index aff54b45d..50932313e 100644 --- a/libreplan-webapp/src/main/resources/i18n/gl.po +++ b/libreplan-webapp/src/main/resources/i18n/gl.po @@ -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" diff --git a/libreplan-webapp/src/main/resources/i18n/keys.pot b/libreplan-webapp/src/main/resources/i18n/keys.pot index 9ee0edb62..b6c2492b2 100644 --- a/libreplan-webapp/src/main/resources/i18n/keys.pot +++ b/libreplan-webapp/src/main/resources/i18n/keys.pot @@ -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 diff --git a/libreplan-webapp/src/main/resources/i18n/zh.po b/libreplan-webapp/src/main/resources/i18n/zh.po index c3b04fd56..e2de4e8a9 100644 --- a/libreplan-webapp/src/main/resources/i18n/zh.po +++ b/libreplan-webapp/src/main/resources/i18n/zh.po @@ -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"