summaryrefslogtreecommitdiff
path: root/src/token.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/token.cc
parentf745767fa68ad26195eed50b8c10dbaccba63e1e (diff)
downloadfork-ledger-238bd7f8a5131e9bc51a649553fd2fafaf6337c2.tar.gz
fork-ledger-238bd7f8a5131e9bc51a649553fd2fafaf6337c2.tar.bz2
fork-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/token.cc')
-rw-r--r--src/token.cc27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/token.cc b/src/token.cc
index e3ce2eb2..3e14fbaf 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -122,7 +122,7 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
return;
}
if (! in.good())
- throw_(parse_error, "Input stream no longer valid");
+ throw_(parse_error, _("Input stream no longer valid"));
char c = peek_next_nonws(in);
@@ -131,7 +131,7 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
return;
}
if (! in.good())
- throw_(parse_error, "Input stream no longer valid");
+ throw_(parse_error, _("Input stream no longer valid"));
symbol[0] = c;
symbol[1] = '\0';
@@ -362,7 +362,7 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
in.clear();
in.seekg(pos, std::ios::beg);
if (in.fail())
- throw_(parse_error, "Failed to reset input stream");
+ throw_(parse_error, _("Failed to reset input stream"));
}
// When in relaxed parsing mode, we want to migrate commodity flags
@@ -385,7 +385,7 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
in.clear();
in.seekg(pos, std::ios::beg);
if (in.fail())
- throw_(parse_error, "Failed to reset input stream");
+ throw_(parse_error, _("Failed to reset input stream"));
c = in.peek();
if (std::isdigit(c) || c == '.')
@@ -412,7 +412,7 @@ void expr_t::token_t::rewind(std::istream& in)
{
in.seekg(- length, std::ios::cur);
if (in.fail())
- throw_(parse_error, "Failed to rewind input stream");
+ throw_(parse_error, _("Failed to rewind input stream"));
}
@@ -424,13 +424,13 @@ void expr_t::token_t::unexpected()
switch (prev_kind) {
case TOK_EOF:
- throw_(parse_error, "Unexpected end of expression");
+ throw_(parse_error, _("Unexpected end of expression"));
case IDENT:
- throw_(parse_error, "Unexpected symbol '" << value << "'");
+ throw_(parse_error, _("Unexpected symbol '%1'") << value);
case VALUE:
- throw_(parse_error, "Unexpected value '" << value << "'");
+ throw_(parse_error, _("Unexpected value '%1'") << value);
default:
- throw_(parse_error, "Unexpected operator '" << symbol << "'");
+ throw_(parse_error, _("Unexpected operator '%1'") << symbol);
}
}
@@ -440,15 +440,14 @@ void expr_t::token_t::expected(char wanted, char c)
if (c == '\0' || c == -1) {
if (wanted == '\0' || wanted == -1)
- throw_(parse_error, "Unexpected end");
+ throw_(parse_error, _("Unexpected end"));
else
- throw_(parse_error, "Missing '" << wanted << "'");
+ throw_(parse_error, _("Missing '%1'") << wanted);
} else {
if (wanted == '\0' || wanted == -1)
- throw_(parse_error, "Invalid char '" << c << "'");
+ throw_(parse_error, _("Invalid char '%1'") << c);
else
- throw_(parse_error, "Invalid char '" << c
- << "' (wanted '" << wanted << "')");
+ throw_(parse_error, _("Invalid char '%1' (wanted '%2')") << c << wanted);
}
}