diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-21 19:52:31 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-21 20:20:57 -0400 |
commit | 66c5cd44277863708fdc81a6418bc84215b0c269 (patch) | |
tree | f78fdbae25244af9260466e2ab01cc3e131491f2 /src/error.cc | |
parent | a577e8c48ebe3b540a6833e1d37025d53c8a42a7 (diff) | |
download | fork-ledger-66c5cd44277863708fdc81a6418bc84215b0c269.tar.gz fork-ledger-66c5cd44277863708fdc81a6418bc84215b0c269.tar.bz2 fork-ledger-66c5cd44277863708fdc81a6418bc84215b0c269.zip |
Use a "format accumulator" for error strings
This makes it possible to internationalize strings while still using
I/O streams. For example:
std::cout << ACCUM(_("Hello to %1 and %2!") << "me" << "you")
<< std::endl;
Diffstat (limited to 'src/error.cc')
-rw-r--r-- | src/error.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/error.cc b/src/error.cc index dbda8c30..ffcd2941 100644 --- a/src/error.cc +++ b/src/error.cc @@ -33,8 +33,10 @@ namespace ledger { -std::ostringstream _desc_buffer; +straccstream _ctxt_accum; std::ostringstream _ctxt_buffer; +straccstream _desc_accum; +std::ostringstream _desc_buffer; string error_context() { |