I18N L10N - Subst
- Localized strings in Subst.
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
109 Empty record in input
|
||||
110 Unrecognized characters at end of line
|
||||
111 Record not recognized as format 4
|
||||
112 Cannot substitute an empty string
|
||||
113 Unrecognized character(s) at end of substitution
|
||||
114 Malformed substitution
|
||||
|
||||
# 2xx Commands
|
||||
200 active
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user