Enhancements - i18n

- Added attribute modifiers.
- Tagged all Mod strings for processing.
This commit is contained in:
Paul Beckingham 2009-06-01 21:38:59 -04:00
parent 0dab0384ea
commit 2faa256a55
3 changed files with 56 additions and 17 deletions

View file

@ -76,6 +76,25 @@
#define ATT_MASK 310
#define ATT_IMASK 311
#define ATT_MOD_BEFORE 350
#define ATT_MOD_AFTER 351
#define ATT_MOD_NOT 352
#define ATT_MOD_NONE 353
#define ATT_MOD_ANY 354
#define ATT_MOD_SYNTH 355
#define ATT_MOD_UNDER 356
#define ATT_MOD_OVER 357
#define ATT_MOD_FIRST 358
#define ATT_MOD_LAST 359
#define ATT_MOD_THIS 360
#define ATT_MOD_NEXT 361
#define ATT_MOD_IS 362
#define ATT_MOD_ISNT 363
#define ATT_MOD_HAS 364
#define ATT_MOD_HASNT 365
#define ATT_MOD_STARTSWITH 366
#define ATT_MOD_ENDSWITH 367
// 4xx Columns
// 5xx Colors

View file

@ -57,6 +57,26 @@
310 mask
311 imask
# 35x Attribute modifiers
350 before
351 after
352 not
353 none
354 any
355 synth
356 under
357 over
358 first
359 last
360 this
361 next
362 is
363 isnt
364 has
365 hasnt
366 startswith
367 endswith
# 4xx Columns
# 5xx Colors

View file

@ -29,7 +29,7 @@
////////////////////////////////////////////////////////////////////////////////
Mod::Mod ()
: std::string ("")
: std::string ("") // i18n: no
{
}
@ -38,7 +38,7 @@ Mod::Mod (const char* other)
: std::string (other)
{
if (!valid ())
throw std::string ("Unrecognized modifier '") + other + "'";
throw std::string ("Unrecognized modifier '") + other + "'"; // i18n: TODO
}
////////////////////////////////////////////////////////////////////////////////
@ -46,7 +46,7 @@ Mod::Mod (const std::string& other)
: std::string (other)
{
if (!valid ())
throw std::string ("Unrecognized modifier '") + other + "'";
throw std::string ("Unrecognized modifier '") + other + "'"; // i18n: TODO
}
////////////////////////////////////////////////////////////////////////////////
@ -57,17 +57,17 @@ Mod::~Mod ()
////////////////////////////////////////////////////////////////////////////////
bool Mod::valid ()
{
if (*this == "before" || *this == "after" ||
*this == "not" ||
*this == "none" || *this == "any" ||
*this == "synth" ||
*this == "under" || *this == "over" ||
*this == "first" || *this == "last" ||
*this == "this" ||
*this == "next" ||
*this == "is" || *this == "isnt" ||
*this == "has" || *this == "hasnt" ||
*this == "startswith" || *this == "endswith")
if (*this == "before" || *this == "after" || // i18n: TODO
*this == "not" || // i18n: TODO
*this == "none" || *this == "any" || // i18n: TODO
*this == "synth" || // i18n: TODO
*this == "under" || *this == "over" || // i18n: TODO
*this == "first" || *this == "last" || // i18n: TODO
*this == "this" || // i18n: TODO
*this == "next" || // i18n: TODO
*this == "is" || *this == "isnt" || // i18n: TODO
*this == "has" || *this == "hasnt" || // i18n: TODO
*this == "startswith" || *this == "endswith") // i18n: TODO
return true;
return false;
@ -77,7 +77,7 @@ bool Mod::valid ()
bool Mod::eval (const Mod& other)
{
// No modifier means automatic pass.
if (*this == "")
if (*this == "") // i18n: no
return true;
// TODO before
@ -93,10 +93,10 @@ bool Mod::eval (const Mod& other)
// TODO this
// TODO next
if (*this == ".is")
if (*this == "is") // i18n: TODO
return *this == other ? true : false;
if (*this == ".isnt")
if (*this == "isnt") // i18n: TODO
return *this != other ? true : false;
// TODO has