mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
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:
parent
76aa3c535e
commit
f43e47a739
9 changed files with 185 additions and 182 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue