mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
I18N L10N - Subst
- Localized strings in Subst.
This commit is contained in:
parent
049767484f
commit
ffa0c6e758
3 changed files with 17 additions and 3 deletions
|
@ -27,6 +27,10 @@
|
|||
|
||||
#include "Subst.h"
|
||||
#include "Nibbler.h"
|
||||
#include "Context.h"
|
||||
#include "i18n.h"
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Subst::Subst ()
|
||||
|
@ -99,13 +103,16 @@ void Subst::parse (const std::string& input)
|
|||
mGlobal = n.skip ('g');
|
||||
|
||||
if (mFrom == "")
|
||||
throw std::string ("Cannot substitute an empty string");
|
||||
throw context.stringtable.get (SUBST_EMPTY,
|
||||
"Cannot substitute an empty string");
|
||||
|
||||
if (!n.depleted ())
|
||||
throw std::string ("Unrecognized character(s) at end of substitution");
|
||||
throw context.stringtable.get (SUBST_BAD_CHARS,
|
||||
"Unrecognized character(s) at end of substitution");
|
||||
}
|
||||
else
|
||||
throw std::string ("Malformed substitution");
|
||||
throw context.stringtable.get (SUBST_MALFORMED,
|
||||
"Malformed substitution");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -46,6 +46,10 @@
|
|||
#define RECORD_EXTRA 110
|
||||
#define RECORD_NOT_FF4 111
|
||||
|
||||
#define SUBST_EMPTY 112
|
||||
#define SUBST_BAD_CHARS 113
|
||||
#define SUBST_MALFORMED 114
|
||||
|
||||
// 2xx Commands
|
||||
#define CMD_ACTIVE 200
|
||||
#define CMD_ADD 201
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue