From 11c013d88c8d728be9b7b18e47d4bbc01e6244c1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 5 Sep 2014 16:51:00 -0400 Subject: [PATCH] Tw-1409 - TW-1409 Allow "1 of N tasks remaining" to be correctly localized (thanks to Jeremy John Reeder). --- ChangeLog | 2 ++ src/feedback.cpp | 8 ++++++-- src/l10n/eng-USA.h | 1 + src/l10n/epo-RUS.h | 1 + src/l10n/esp-ESP.h | 1 + src/l10n/fra-FRA.h | 1 + src/l10n/ita-ITA.h | 1 + src/l10n/por-PRT.h | 1 + 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d050681f..0fb80896a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -151,6 +151,8 @@ - TW-1403 fish shell: no option "modify" after task selection (thanks to Roman Infliansksas). - TW-1405 Add command _zshattributes (thanks to Roman Inflianskas). +- TW-1409 Allow "1 of N tasks remaining" to be correctly localized (thanks to + Jeremy John Reeder). - Removed deprecated 'echo.command' setting, in favor of the 'header' and 'affected' verbosity tokens. - Removed deprecated 'edit.verbose' setting, in favor of the 'edit' verbosity diff --git a/src/feedback.cpp b/src/feedback.cpp index 0af60f784..36c883ced 100644 --- a/src/feedback.cpp +++ b/src/feedback.cpp @@ -473,8 +473,12 @@ std::string onProjectChange (Task& task, bool scope /* = true */) percentage = (count_done * 100 / (count_done + count_pending)); msg << format (STRING_HELPER_PROJECT_COMPL, project, percentage) - << " " - << format (STRING_HELPER_PROJECT_REM, count_pending, count_pending + count_done); + << " "; + + if (count_pending > 1) + msg << format (STRING_HELPER_PROJECT_REM, count_pending, count_pending + count_done); + else + msg << format (STRING_HELPER_PROJECT_REM1, count_pending); } return msg.str (); diff --git a/src/l10n/eng-USA.h b/src/l10n/eng-USA.h index 91414b0e0..72d2f54db 100644 --- a/src/l10n/eng-USA.h +++ b/src/l10n/eng-USA.h @@ -791,6 +791,7 @@ #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." #define STRING_HELPER_PROJECT_COMPL "Project '{1}' is {2}% complete" #define STRING_HELPER_PROJECT_REM "({1} of {2} tasks remaining)." +#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." // JSON #define STRING_JSON_MISSING_VALUE "Error: missing value after ',' at position {1}" diff --git a/src/l10n/epo-RUS.h b/src/l10n/epo-RUS.h index c94359a7b..55d230d36 100644 --- a/src/l10n/epo-RUS.h +++ b/src/l10n/epo-RUS.h @@ -791,6 +791,7 @@ #define STRING_HELPER_PROJECT_CHANGE "Projekto '{1}' ŝanĝis." #define STRING_HELPER_PROJECT_COMPL "Projekto '{1}' estas {2}% kompleta" #define STRING_HELPER_PROJECT_REM "(Restas {1} de {2} taskoj)." +#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." // JSON #define STRING_JSON_MISSING_VALUE "Eraro: mankas valoro post ',' ĉe pozicio {1}" diff --git a/src/l10n/esp-ESP.h b/src/l10n/esp-ESP.h index 7bed6a347..71d42bb1e 100644 --- a/src/l10n/esp-ESP.h +++ b/src/l10n/esp-ESP.h @@ -803,6 +803,7 @@ #define STRING_HELPER_PROJECT_CHANGE "El proyecto '{1}' ha cambiado." #define STRING_HELPER_PROJECT_COMPL "El proyecto '{1}' se ha completado en un {2}%" #define STRING_HELPER_PROJECT_REM "(quedan {1} de {2} tareas)." +#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." // JSON #define STRING_JSON_MISSING_VALUE "Error: falta valor después de ',' en posición {1}" diff --git a/src/l10n/fra-FRA.h b/src/l10n/fra-FRA.h index 9d154cadc..f7256fd03 100644 --- a/src/l10n/fra-FRA.h +++ b/src/l10n/fra-FRA.h @@ -790,6 +790,7 @@ #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." #define STRING_HELPER_PROJECT_COMPL "Project '{1}' is {2}% complete" #define STRING_HELPER_PROJECT_REM "({1} of {2} tasks remaining)." +#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." // JSON #define STRING_JSON_MISSING_VALUE "Erreur : valeur manquante après ',' à la position {1}" diff --git a/src/l10n/ita-ITA.h b/src/l10n/ita-ITA.h index 3dd6a0ec2..51c04cb23 100644 --- a/src/l10n/ita-ITA.h +++ b/src/l10n/ita-ITA.h @@ -791,6 +791,7 @@ #define STRING_HELPER_PROJECT_CHANGE "Il progetto '{1}' è stato modificat." #define STRING_HELPER_PROJECT_COMPL "Il progetto '{1}' è {2}% completo" #define STRING_HELPER_PROJECT_REM "({1} di {2} task rimanenti)." +#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." // JSON #define STRING_JSON_MISSING_VALUE "Errore: mancato valore dopo ',' alla posizione {1}" diff --git a/src/l10n/por-PRT.h b/src/l10n/por-PRT.h index 5f67b2d3d..ab41f59a2 100644 --- a/src/l10n/por-PRT.h +++ b/src/l10n/por-PRT.h @@ -791,6 +791,7 @@ #define STRING_HELPER_PROJECT_CHANGE "O projeto '{1}' foi alterado." #define STRING_HELPER_PROJECT_COMPL "Projeto '{1}' está {2}% concluído" #define STRING_HELPER_PROJECT_REM "(Restam {1} de {2} tarefas)." +#define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." // JSON #define STRING_JSON_MISSING_VALUE "Erro: valor em falta após ',' na posição {1}"