summaryrefslogtreecommitdiff
path: root/src/interactive.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-25 03:51:42 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-25 03:51:42 -0400
commit238bd7f8a5131e9bc51a649553fd2fafaf6337c2 (patch)
treeb8ba95c43cbf66ed98abab8cc0c1944aa03ea50f /src/interactive.cc
parentf745767fa68ad26195eed50b8c10dbaccba63e1e (diff)
downloadledger-238bd7f8a5131e9bc51a649553fd2fafaf6337c2.tar.gz
ledger-238bd7f8a5131e9bc51a649553fd2fafaf6337c2.tar.bz2
ledger-238bd7f8a5131e9bc51a649553fd2fafaf6337c2.zip
Marked all strings needing internationalization
These strings are now collected automagically in the file po/ledger.pot. If you'd like to produce a translation, just run this command after building Ledger: msginit -l LOCALE -o LANG.po -i po/ledger.pot Where LOCALE is a string like de or en_GB, and LANG is a short descriptive word for your language. Then send me this .po file so I can commit it to the Ledger sources (alternatively, you could maintain the file in a fork on GitHub), and setup the build script to format and install your new message catalog during a "make install".
Diffstat (limited to 'src/interactive.cc')
-rw-r--r--src/interactive.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/interactive.cc b/src/interactive.cc
index 9bb10c07..a1d2933f 100644
--- a/src/interactive.cc
+++ b/src/interactive.cc
@@ -38,7 +38,7 @@ void interactive_t::verify_arguments() const
value_t::sequence_t::const_iterator i;
const char * p = spec.c_str();
- const char * label = "unknown";
+ const char * label = _("unknown");
bool wrong_arg = false;
bool dont_skip = false;
bool optional = *p == '&';
@@ -62,22 +62,22 @@ void interactive_t::verify_arguments() const
"Want " << *p << " got: " << next_arg->label());
switch (*p) {
case 'a':
- label = "an amount";
+ label = _("an amount");
wrong_arg = (! next_arg->is_long() &&
! next_arg->is_amount() &&
! next_arg->is_balance());
break;
case 'b':
- label = "a boolean";
+ label = _("a boolean");
wrong_arg = false; // booleans are converted
break;
case 'd':
- label = "a date";
+ label = _("a date");
wrong_arg = ! next_arg->is_date();
break;
case 'i':
case 'l':
- label = "an integer";
+ label = _("an integer");
if (next_arg->is_long() ||
(next_arg->is_amount() &&
! next_arg->as_amount().has_commodity())) {
@@ -97,28 +97,28 @@ void interactive_t::verify_arguments() const
}
break;
case 'm':
- label = "a regex";
+ label = _("a regex");
wrong_arg = ! next_arg->is_mask();
break;
case 's':
- label = "a string";
+ label = _("a string");
wrong_arg = ! next_arg->is_string();
break;
case 't':
- label = "a date or time";
+ label = _("a date or time");
wrong_arg = (! next_arg->is_date() &&
! next_arg->is_datetime());
break;
case 'v':
- label = "any value";
+ label = _("any value");
wrong_arg = false;
break;
case 'P':
- label = "a pointer";
+ label = _("a pointer");
wrong_arg = ! next_arg->is_pointer();
break;
case 'S':
- label = "a sequence";
+ label = _("a sequence");
wrong_arg = false;
break;
case '&':
@@ -157,14 +157,14 @@ void interactive_t::verify_arguments() const
if (wrong_arg) {
throw_(std::logic_error,
- "Expected " << label << " for argument " << offset
- << ", but received " << vlabel);
+ _("Expected %1 for argument %2, but received %3")
+ << label << offset << vlabel);
}
else if (*p && ! optional && ! next_arg) {
- throw_(std::logic_error, "Too few arguments to function");
+ throw_(std::logic_error, _("Too few arguments to function"));
}
else if (! *p && next_arg) {
- throw_(std::logic_error, "Too many arguments to function");
+ throw_(std::logic_error, _("Too many arguments to function"));
}
}