From 2faa256a55f1ad3b0a0002a0e69db79ca9076e9f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 1 Jun 2009 21:38:59 -0400 Subject: [PATCH] Enhancements - i18n - Added attribute modifiers. - Tagged all Mod strings for processing. --- i18n/i18n.h | 19 +++++++++++++++++++ i18n/strings.en-US | 20 ++++++++++++++++++++ src/Mod.cpp | 34 +++++++++++++++++----------------- 3 files changed, 56 insertions(+), 17 deletions(-) diff --git a/i18n/i18n.h b/i18n/i18n.h index 94cdae763..63a21ca8a 100644 --- a/i18n/i18n.h +++ b/i18n/i18n.h @@ -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 diff --git a/i18n/strings.en-US b/i18n/strings.en-US index d6b76a485..8d75b86f2 100644 --- a/i18n/strings.en-US +++ b/i18n/strings.en-US @@ -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 diff --git a/src/Mod.cpp b/src/Mod.cpp index 4fb66777c..12a5e6af8 100644 --- a/src/Mod.cpp +++ b/src/Mod.cpp @@ -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