- Localized more files.
This commit is contained in:
Paul Beckingham 2011-07-01 22:33:49 -04:00
parent 99d25bd0db
commit 59ccad5b62
2 changed files with 24 additions and 10 deletions

View file

@ -25,12 +25,15 @@
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#define L10N // Localization complete.
#include <sstream> #include <sstream>
#include <stdlib.h> #include <stdlib.h>
#include <Context.h> #include <Context.h>
#include <ViewText.h> #include <ViewText.h>
#include <Duration.h> #include <Duration.h>
#include <text.h> #include <text.h>
#include <i18n.h>
#include <main.h> #include <main.h>
#include <CmdSummary.h> #include <CmdSummary.h>
@ -41,7 +44,7 @@ CmdSummary::CmdSummary ()
{ {
_keyword = "summary"; _keyword = "summary";
_usage = "task summary"; _usage = "task summary";
_description = "Shows a report of task status by project."; _description = STRING_CMD_SUMMARY_USAGE;
_read_only = true; _read_only = true;
_displays_id = false; _displays_id = false;
} }
@ -120,10 +123,10 @@ int CmdSummary::execute (std::string& output)
// Create a table for output. // Create a table for output.
ViewText view; ViewText view;
view.width (context.getWidth ()); view.width (context.getWidth ());
view.add (Column::factory ("string", "Project")); view.add (Column::factory ("string", STRING_CMD_SUMMARY_PROJECT));
view.add (Column::factory ("string.right", "Remaining")); view.add (Column::factory ("string.right", STRING_CMD_SUMMARY_REMAINING));
view.add (Column::factory ("string.right", "Avg age")); view.add (Column::factory ("string.right", STRING_CMD_SUMMARY_AVG_AGE));
view.add (Column::factory ("string.right", "Complete")); view.add (Column::factory ("string.right", STRING_CMD_SUMMARY_COMPLETE));
view.add (Column::factory ("string", "0% 100%")); view.add (Column::factory ("string", "0% 100%"));
Color bar_color (context.config.get ("color.summary.bar")); Color bar_color (context.config.get ("color.summary.bar"));
@ -167,14 +170,20 @@ int CmdSummary::execute (std::string& output)
std::stringstream out; std::stringstream out;
if (view.rows ()) if (view.rows ())
{
out << optionalBlankLine () out << optionalBlankLine ()
<< view.render () << view.render ()
<< optionalBlankLine () << optionalBlankLine ();
<< view.rows ()
<< (view.rows () == 1 ? " project" : " projects") if (view.rows ())
<< "\n"; out << format (STRING_CMD_PROJECTS_SUMMARY2, view.rows ());
else
out << STRING_CMD_PROJECTS_SUMMARY;
out << "\n";
}
else { else {
out << "No projects.\n"; out << STRING_CMD_PROJECTS_NO << "\n";
rc = 1; rc = 1;
} }

View file

@ -248,6 +248,11 @@
#define STRING_CMD_PROJECTS_SUMMARY2 "{1} projects" #define STRING_CMD_PROJECTS_SUMMARY2 "{1} projects"
#define STRING_CMD_PROJECTS_TASK "({1} task)" #define STRING_CMD_PROJECTS_TASK "({1} task)"
#define STRING_CMD_PROJECTS_TASKS "({1} tasks)" #define STRING_CMD_PROJECTS_TASKS "({1} tasks)"
#define STRING_CMD_SUMMARY_USAGE "Shows a report of task status by project."
#define STRING_CMD_SUMMARY_PROJECT "Project"
#define STRING_CMD_SUMMARY_REMAINING "Remaining"
#define STRING_CMD_SUMMARY_AVG_AGE "Avg age"
#define STRING_CMD_SUMMARY_COMPLETE "Complete"
// Config // Config
#define STRING_CONFIG_OVERNEST "Configuration file nested to more than 10 levels deep - this has to be a mistake." #define STRING_CONFIG_OVERNEST "Configuration file nested to more than 10 levels deep - this has to be a mistake."