I18N L10N - Sequence
- Sequence object localized. - StringTable changed to inherit from std::map. - StringTable copy constructor, assignment operator removed. - Various source files tagged for further l10n work.
This commit is contained in:
@@ -31,8 +31,12 @@
|
||||
#include <ctype.h>
|
||||
#include "util.h"
|
||||
#include "text.h"
|
||||
#include "i18n.h"
|
||||
#include "Context.h"
|
||||
#include "Sequence.h"
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Sequence::Sequence ()
|
||||
{
|
||||
@@ -66,7 +70,7 @@ void Sequence::parse (const std::string& input)
|
||||
case 1:
|
||||
{
|
||||
if (! validId (range[0]))
|
||||
throw std::string ("Invalid ID in sequence");
|
||||
throw context.stringtable.get (SEQUENCE_BAD_SEQ, "Invalid ID in sequence");
|
||||
|
||||
int id = ::atoi (range[0].c_str ());
|
||||
this->push_back (id);
|
||||
@@ -77,15 +81,15 @@ void Sequence::parse (const std::string& input)
|
||||
{
|
||||
if (! validId (range[0]) ||
|
||||
! validId (range[1]))
|
||||
throw std::string ("Invalid ID in range");
|
||||
throw context.stringtable.get (SEQUENCE_BAD_SEQ, "Invalid ID in range");
|
||||
|
||||
int low = ::atoi (range[0].c_str ());
|
||||
int high = ::atoi (range[1].c_str ());
|
||||
if (low > high)
|
||||
throw std::string ("Inverted sequence range high-low");
|
||||
throw context.stringtable.get (SEQUENCE_INVERTED, "Inverted sequence range high-low");
|
||||
|
||||
if (high - low >= SEQUENCE_MAX)
|
||||
throw std::string ("ID Range too large");
|
||||
throw context.stringtable.get (SEQUENCE_RANGE_MAX, "ID Range too large");
|
||||
|
||||
for (int i = low; i <= high; ++i)
|
||||
this->push_back (i);
|
||||
@@ -93,7 +97,7 @@ void Sequence::parse (const std::string& input)
|
||||
break;
|
||||
|
||||
default:
|
||||
throw std::string ("Not a sequence.");
|
||||
throw context.stringtable.get (SEQUENCE_NOT_A_SEQUENCE, "Not a sequence.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user