diff --git a/src/commands/CmdLog.cpp b/src/commands/CmdLog.cpp index bbd5dcfac..7ce7c8665 100644 --- a/src/commands/CmdLog.cpp +++ b/src/commands/CmdLog.cpp @@ -68,10 +68,10 @@ int CmdLog::execute (std::string& output) // Recurring tasks get a special status. if (task.has ("recur")) - throw std::string ("You cannot log recurring tasks."); + throw std::string (STRING_CMD_LOG_NO_RECUR); if (task.has ("wait")) - throw std::string ("You cannot log waiting tasks."); + throw std::string (STRING_CMD_LOG_NO_WAITING); // Override with log-specific changes. task.setStatus (Task::completed); @@ -91,7 +91,7 @@ int CmdLog::execute (std::string& output) context.tdb.unlock (); if (context.config.getBoolean ("echo.command")) - output = "Logged task.\n"; + output = std::string (STRING_CMD_LOG_LOGGED) + "\n"; return rc; } diff --git a/src/en-US.h b/src/en-US.h index e30ba629e..5680f2f4c 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -176,6 +176,9 @@ #define STRING_CMD_ADD_BAD_ATTRIBUTE "Unrecognized attribute '{1}'." #define STRING_CMD_MOD_UNEXPECTED "Unexpected argument '{1}' found while modifying a task." #define STRING_CMD_LOG_USAGE "Adds a new task that is already completed." +#define STRING_CMD_LOG_NO_RECUR "You cannot log recurring tasks." +#define STRING_CMD_LOG_NO_WAITING "You cannot log waiting tasks." +#define STRING_CMD_LOG_LOGGED "Logged task." #define STRING_CMD_IDS_USAGE_RANGE "Shows only the IDs of matching tasks, in the form of a range." #define STRING_CMD_IDS_USAGE_LIST "Shows only the IDs of matching tasks, in the form of a list." #define STRING_CMD_IDS_USAGE_ZSH "Shows the IDs and descriptions of matching tasks."