From 0a62061ca813587b2705b81ac1b1a114e902e1c0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 15 Feb 2015 02:03:24 -0500 Subject: [PATCH] L10N - Localized the new strings in Hooks.cpp. --- src/Hooks.cpp | 25 +++++++++++++------------ src/l10n/deu-DEU.h | 20 ++++++++++++++++---- src/l10n/eng-USA.h | 12 ++++++++++++ src/l10n/epo-RUS.h | 20 ++++++++++++++++---- src/l10n/esp-ESP.h | 20 ++++++++++++++++---- src/l10n/fra-FRA.h | 12 ++++++++++++ src/l10n/ita-ITA.h | 12 ++++++++++++ src/l10n/pol-POL.h | 20 ++++++++++++++++---- src/l10n/por-PRT.h | 20 ++++++++++++++++---- 9 files changed, 129 insertions(+), 32 deletions(-) diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 54519f99a..342b5f3b1 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -41,6 +41,7 @@ #include #include #include +#include extern Context context; @@ -109,7 +110,7 @@ bool Hooks::enable (bool value) // - none // // Output: -// - all emitted JSON is ignored. +// - JSON not allowed. // - all emitted non-JSON lines are considered feedback or error messages // depending on the status code. // @@ -420,7 +421,7 @@ void Hooks::assertValidJSON (const std::vector & input) const (*i)[0] != '{' || (*i)[i->length () - 1] != '}') { - context.error ("Hook Error: JSON Object '{...}' expected."); + context.error (STRING_HOOK_ERROR_OBJECT); throw 0; } @@ -429,34 +430,34 @@ void Hooks::assertValidJSON (const std::vector & input) const json::value* root = json::parse (*i); if (root->type () != json::j_object) { - context.error ("Hook Error: JSON Object '{...}' expected."); + context.error (STRING_HOOK_ERROR_OBJECT); throw 0; } if (((json::object*)root)->_data.find ("description") == ((json::object*)root)->_data.end ()) { - context.error ("Hook Error: JSON Object missing 'description' attribute."); + context.error (STRING_HOOK_ERROR_NODESC); throw 0; } if (((json::object*)root)->_data.find ("uuid") == ((json::object*)root)->_data.end ()) { - context.error ("Hook Error: JSON Object missing 'uuid' attribute."); + context.error (STRING_HOOK_ERROR_NOUUID); throw 0; } } catch (const std::string& e) { - context.error ("Hook Error: JSON syntax error in: " + *i); + context.error (format (STRING_HOOK_ERROR_SYNTAX, *i)); if (_debug) - context.error ("Hook Error: JSON " + e); + context.error (STRING_HOOK_ERROR_JSON + e); throw 0; } catch (...) { - context.error ("Hook Error: JSON failed to parse: " + *i); + context.error (STRING_HOOK_ERROR_NOPARSE + *i); throw 0; } } @@ -467,7 +468,7 @@ void Hooks::assertNTasks (const std::vector & input, int n) const { if (input.size () != n) { - context.error (format ("Hook Error: Expected {1} JSON task(s), found {2}", n, (int) input.size ())); + context.error (format (STRING_HOOK_ERROR_BAD_NUM, n, (int) input.size ())); throw 0; } } @@ -487,7 +488,7 @@ void Hooks::assertSameTask (const std::vector & input, const Task& if (u == root_obj->_data.end () || u->second->type () != json::j_string) { - context.error (format ("Hook Error: JSON must be for the same task: {1}", uuid)); + context.error (format (STRING_HOOK_ERROR_SAME1, uuid)); throw 0; } @@ -495,7 +496,7 @@ void Hooks::assertSameTask (const std::vector & input, const Task& std::string json_uuid = json::decode (unquoteText (up->dump ())); if (json_uuid != uuid) { - context.error (format ("Hook Error: JSON must be for the same task: {1} != {2}", uuid, json_uuid)); + context.error (format (STRING_HOOK_ERROR_SAME2, uuid, json_uuid)); throw 0; } } @@ -512,7 +513,7 @@ void Hooks::assertFeedback (const std::vector & input) const if (! foundSomething) { - context.error ("Hook Error: Expected feedback from a failing hook script."); + context.error (STRING_HOOK_ERROR_NOFEEDBACK); throw 0; } } diff --git a/src/l10n/deu-DEU.h b/src/l10n/deu-DEU.h index 48d568ea0..f65d6a238 100644 --- a/src/l10n/deu-DEU.h +++ b/src/l10n/deu-DEU.h @@ -792,10 +792,22 @@ #define STRING_FILE_PERMS "Taskwarrior hat die erforderlichen Rechte auf '{1}' nicht." // helpers -#define STRING_HELPER_PROJECT_CHANGE "Projekt '{1}' wurde geändert." -#define STRING_HELPER_PROJECT_COMPL "Projekt '{1}' ist zu {2}% abgeschlossen" -#define STRING_HELPER_PROJECT_REM "({1} von {2} Aufgaben verbleibend)." -#define STRING_HELPER_PROJECT_REM1 "({1} Aufgabe verbleibend)." +#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)." + +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." // JSON #define STRING_JSON_MISSING_VALUE "Fehler: Fehlender Wert nach ',' an Position {1}" diff --git a/src/l10n/eng-USA.h b/src/l10n/eng-USA.h index 0e45daf8f..d14e8a6a8 100644 --- a/src/l10n/eng-USA.h +++ b/src/l10n/eng-USA.h @@ -797,6 +797,18 @@ #define STRING_HELPER_PROJECT_REM "({1} of {2} tasks remaining)." #define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." + // JSON #define STRING_JSON_MISSING_VALUE "Error: missing value after ',' at position {1}" #define STRING_JSON_MISSING_VALUE2 "Error: missing value at position {1}" diff --git a/src/l10n/epo-RUS.h b/src/l10n/epo-RUS.h index 5783cdc5b..e9c7fb5a5 100644 --- a/src/l10n/epo-RUS.h +++ b/src/l10n/epo-RUS.h @@ -792,10 +792,22 @@ #define STRING_FILE_PERMS "Taskwarrior ne havas la bezonatan permeson por '{1}'." // helpers -#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 "(Restas {1} tasko)." +#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)." + +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." // 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 1023081f4..c1752f88c 100644 --- a/src/l10n/esp-ESP.h +++ b/src/l10n/esp-ESP.h @@ -801,10 +801,22 @@ #define STRING_FILE_PERMS "Taskwarrior no tiene los permisos adecuados para '{1}'." // helpers -#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 "(quada {1} tasko)." +#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)." + +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." // 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 e0799fbf3..24ab905d2 100644 --- a/src/l10n/fra-FRA.h +++ b/src/l10n/fra-FRA.h @@ -797,6 +797,18 @@ #define STRING_HELPER_PROJECT_REM "({1} of {2} tasks remaining)." #define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." + // JSON #define STRING_JSON_MISSING_VALUE "Erreur : valeur manquante après ',' à la position {1}" #define STRING_JSON_MISSING_VALUE2 "Erreur : valeur manquante à la position {1}" diff --git a/src/l10n/ita-ITA.h b/src/l10n/ita-ITA.h index 95d8ef80f..c005921e9 100644 --- a/src/l10n/ita-ITA.h +++ b/src/l10n/ita-ITA.h @@ -796,6 +796,18 @@ #define STRING_HELPER_PROJECT_REM "({1} di {2} task rimanenti)." #define STRING_HELPER_PROJECT_REM1 "({1} task remaining)." +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." + // JSON #define STRING_JSON_MISSING_VALUE "Errore: mancato valore dopo ',' alla posizione {1}" #define STRING_JSON_MISSING_VALUE2 "Errore: mancato valore alla posizione {1}" diff --git a/src/l10n/pol-POL.h b/src/l10n/pol-POL.h index 78ec507a5..9283aba01 100644 --- a/src/l10n/pol-POL.h +++ b/src/l10n/pol-POL.h @@ -792,10 +792,22 @@ #define STRING_FILE_PERMS "Taskwarrior nie posiada praw dostępu do '{1}'." // helpers -#define STRING_HELPER_PROJECT_CHANGE "Projekt '{1}' uległ zmianie." -#define STRING_HELPER_PROJECT_COMPL "Projekt '{1}' w {2}% ukończony" -#define STRING_HELPER_PROJECT_REM "({1} z {2} zadań pozostało)." -#define STRING_HELPER_PROJECT_REM1 "({1} zadań pozostało)." +#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)." + +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." // JSON #define STRING_JSON_MISSING_VALUE "Błąd: brak wartości po ',' na pozycji {1}" diff --git a/src/l10n/por-PRT.h b/src/l10n/por-PRT.h index fbab70bec..0ac1463da 100644 --- a/src/l10n/por-PRT.h +++ b/src/l10n/por-PRT.h @@ -792,10 +792,22 @@ #define STRING_FILE_PERMS "O taskwarrior não encontrou as permissões corretas em '{1}'." // helpers -#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} tarefas em falta)." +#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)." + +// Hooks +#define STRING_HOOK_ERROR_OBJECT "Hook Error: JSON Object '{...}' expected." +#define STRING_HOOK_ERROR_NODESC "Hook Error: JSON Object missing 'description' attribute." +#define STRING_HOOK_ERROR_NOUUID "Hook Error: JSON Object missing 'uuid' attribute." +#define STRING_HOOK_ERROR_SYNTAX "Hook Error: JSON syntax error in: {1}" +#define STRING_HOOK_ERROR_JSON "Hook Error: JSON " +#define STRING_HOOK_ERROR_NOPARSE "Hook Error: JSON failed to parse: " +#define STRING_HOOK_ERROR_BAD_NUM "Hook Error: Expected {1} JSON task(s), found {2}" +#define STRING_HOOK_ERROR_SAME1 "Hook Error: JSON must be for the same task: {1}" +#define STRING_HOOK_ERROR_SAME2 "Hook Error: JSON must be for the same task: {1} != {2}" +#define STRING_HOOK_ERROR_NOFEEDBACK "Hook Error: Expected feedback from a failing hook script." // JSON #define STRING_JSON_MISSING_VALUE "Erro: valor em falta após ',' na posição {1}"