diff --git a/src/commands/CmdMerge.cpp b/src/commands/CmdMerge.cpp index a517fac55..f0c565414 100644 --- a/src/commands/CmdMerge.cpp +++ b/src/commands/CmdMerge.cpp @@ -25,11 +25,14 @@ // //////////////////////////////////////////////////////////////////////////////// +#define L10N // Localization complete. + #include #include #include #include #include +#include #include #include #include @@ -41,7 +44,7 @@ CmdMerge::CmdMerge () { _keyword = "merge"; _usage = "task merge URL"; - _description = "Merges the specified undo.data file with the local data files."; + _description = STRING_CMD_MERGE_USAGE; _read_only = false; _displays_id = false; } @@ -88,13 +91,13 @@ int CmdMerge::execute (std::string& output) context.tdb2.merge (file); - output += "Merge complete.\n"; + output += std::string (STRING_CMD_MERGE_COMPLETE) + "\n"; if (tmpfile != "") remove (tmpfile.c_str ()); - if ( ((sAutopush == "ask") && (confirm ("Would you like to push the merged changes to \'" + uri._data + "\'?")) ) - || (bAutopush) ) + if (((sAutopush == "ask") && (confirm (format (STRING_CMD_MERGE_CONFIRM, uri._data)))) + || (bAutopush)) { // Derive autopush uri from merge.default.uri? otherwise: change prompt above @@ -117,9 +120,7 @@ int CmdMerge::execute (std::string& output) } } else - throw std::string ("No uri was specified for the merge. Either specify " - "the uri of a remote .task directory, or create a " - "'merge.default.uri' entry in your .taskrc file."); + throw std::string (STRING_CMD_MERGE_NO_URI); return 0; } diff --git a/src/en-US.h b/src/en-US.h index 8c8cff380..7f927aae7 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -355,7 +355,6 @@ #define STRING_CMD_DIAG_UUID_GOOD "1000 unique UUIDs generated." #define STRING_CMD_DIAG_UUID_BAD "Failed - duplicate UUID at iteration {1}" #define STRING_CMD_DIAG_NONE "-none-" - #define STRING_CMD_PUSH_USAGE "Pushes the local *.data files to the URL." #define STRING_CMD_PUSH_SAME "Cannot push files when the source and destination are the same." #define STRING_CMD_PUSH_NONLOCAL "The uri '{1}' is not a local directory." @@ -414,6 +413,10 @@ #define STRING_CMD_TIMESHEET_USAGE "Shows a weekly report of tasks completed and started." #define STRING_CMD_TIMESHEET_STARTED "Started ({1} tasks)" #define STRING_CMD_TIMESHEET_DONE "Completed ({1} tasks)" +#define STRING_CMD_MERGE_USAGE "Merges the specified undo.data file with the local data files." +#define STRING_CMD_MERGE_COMPLETE "Merge complete." +#define STRING_CMD_MERGE_CONFIRM "Would you like to push the merged changes to '{1}'?" +#define STRING_CMD_MERGE_NO_URI "No uri was specified for the merge. Either specify the uri of a remote .task directory, or create a 'merge.default.uri' entry in your .taskrc file." // Config #define STRING_CONFIG_OVERNEST "Configuration file nested to more than 10 levels deep - this has to be a mistake."