- Completed localizing CmdLog.cpp.
This commit is contained in:
Paul Beckingham 2011-07-09 17:50:21 -04:00
parent f483d1ed9d
commit 3abb4d7dd6
2 changed files with 6 additions and 3 deletions

View file

@ -68,10 +68,10 @@ int CmdLog::execute (std::string& output)
// Recurring tasks get a special status. // Recurring tasks get a special status.
if (task.has ("recur")) if (task.has ("recur"))
throw std::string ("You cannot log recurring tasks."); throw std::string (STRING_CMD_LOG_NO_RECUR);
if (task.has ("wait")) 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. // Override with log-specific changes.
task.setStatus (Task::completed); task.setStatus (Task::completed);
@ -91,7 +91,7 @@ int CmdLog::execute (std::string& output)
context.tdb.unlock (); context.tdb.unlock ();
if (context.config.getBoolean ("echo.command")) if (context.config.getBoolean ("echo.command"))
output = "Logged task.\n"; output = std::string (STRING_CMD_LOG_LOGGED) + "\n";
return rc; return rc;
} }

View file

@ -176,6 +176,9 @@
#define STRING_CMD_ADD_BAD_ATTRIBUTE "Unrecognized attribute '{1}'." #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_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_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_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_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." #define STRING_CMD_IDS_USAGE_ZSH "Shows the IDs and descriptions of matching tasks."