diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index 571216ba9..7d67e9a7c 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -25,6 +25,8 @@ // //////////////////////////////////////////////////////////////////////////////// +#define L10N // Localization complete. + #include #include #include @@ -33,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -401,11 +405,11 @@ std::string Chart::render () if (graph_height < 5 || // a 4-line graph is essentially unreadable. graph_width < 2) // A single-bar graph is useless. { - return "Terminal window too small to draw a graph.\n"; + return std::string (STRING_CMD_BURN_TOO_SMALL) + "\n"; } if (max_value == 0) - return "No matches.\n"; + return std::string (STRING_FEEDBACK_NO_MATCH) + "\n"; // Create a grid, folded into a string. grid = ""; @@ -416,12 +420,12 @@ std::string Chart::render () std::string full_title; switch (period) { - case 'D': full_title = "Daily"; break; - case 'W': full_title = "Weekly"; break; - case 'M': full_title = "Monthly"; break; + case 'D': full_title = STRING_CMD_BURN_DAILY; break; + case 'W': full_title = STRING_CMD_BURN_WEEKLY; break; + case 'M': full_title = STRING_CMD_BURN_MONTHLY; break; } - full_title += " Burndown"; + full_title += std::string (" ") + STRING_CMD_BURN_TITLE; if (title.length ()) { @@ -442,9 +446,9 @@ std::string Chart::render () } // Legend. - grid.replace (LOC (graph_height / 2 - 1, width - 10), 10, "DD Done "); - grid.replace (LOC (graph_height / 2, width - 10), 10, "SS Started"); - grid.replace (LOC (graph_height / 2 + 1, width - 10), 10, "PP Pending"); + grid.replace (LOC (graph_height / 2 - 1, width - 10), 10, "DD " + leftJustify (STRING_CMD_BURN_DONE, 7)); + grid.replace (LOC (graph_height / 2, width - 10), 10, "SS " + leftJustify (STRING_CMD_BURN_STARTED, 7)); + grid.replace (LOC (graph_height / 2 + 1, width - 10), 10, "PP " + leftJustify (STRING_CMD_BURN_PENDING, 7)); // Determine y-axis labelling. std::vector labels; @@ -924,7 +928,7 @@ void Chart::calculateRates (std::vector & sequence) } else { - completion = "No convergence"; + completion = STRING_CMD_BURN_NO_CONVERGE; } } @@ -933,7 +937,7 @@ CmdBurndownMonthly::CmdBurndownMonthly () { _keyword = "burndown.monthly"; _usage = "task burndown.monthly"; - _description = "Shows a graphical burndown chart, by month"; + _description = STRING_CMD_BURN_USAGE_M; _read_only = true; _displays_id = false; } @@ -971,7 +975,7 @@ CmdBurndownWeekly::CmdBurndownWeekly () { _keyword = "burndown.weekly"; _usage = "task burndown.weekly"; - _description = "Shows a graphical burndown chart, by week"; + _description = STRING_CMD_BURN_USAGE_W; _read_only = true; _displays_id = false; } @@ -1009,7 +1013,7 @@ CmdBurndownDaily::CmdBurndownDaily () { _keyword = "burndown.daily"; _usage = "task burndown.daily"; - _description = "Shows a graphical burndown chart, by day"; + _description = STRING_CMD_BURN_USAGE_D; _read_only = true; _displays_id = false; } diff --git a/src/en-US.h b/src/en-US.h index 7f927aae7..12ff7ebd4 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -417,6 +417,18 @@ #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." +#define STRING_CMD_BURN_USAGE_M "Shows a graphical burndown chart, by month" +#define STRING_CMD_BURN_USAGE_W "Shows a graphical burndown chart, by week" +#define STRING_CMD_BURN_USAGE_D "Shows a graphical burndown chart, by day" +#define STRING_CMD_BURN_TITLE "Burndown" +#define STRING_CMD_BURN_TOO_SMALL "Terminal window too small to draw a graph." +#define STRING_CMD_BURN_DAILY "Daily" +#define STRING_CMD_BURN_WEEKLY "Weekly" +#define STRING_CMD_BURN_MONTHLY "Monthly" +#define STRING_CMD_BURN_STARTED "Started" // Must be 7 or fewer characters +#define STRING_CMD_BURN_DONE "Done" // Must be 7 or fewer characters +#define STRING_CMD_BURN_PENDING "Pending" // Must be 7 or fewer characters +#define STRING_CMD_BURN_NO_CONVERGE "No convergence" // Config #define STRING_CONFIG_OVERNEST "Configuration file nested to more than 10 levels deep - this has to be a mistake."