mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Enhancements - i18n
- Added attribute modifiers. - Tagged all Mod strings for processing.
This commit is contained in:
parent
0dab0384ea
commit
2faa256a55
3 changed files with 56 additions and 17 deletions
19
i18n/i18n.h
19
i18n/i18n.h
|
@ -76,6 +76,25 @@
|
||||||
#define ATT_MASK 310
|
#define ATT_MASK 310
|
||||||
#define ATT_IMASK 311
|
#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
|
// 4xx Columns
|
||||||
|
|
||||||
// 5xx Colors
|
// 5xx Colors
|
||||||
|
|
|
@ -57,6 +57,26 @@
|
||||||
310 mask
|
310 mask
|
||||||
311 imask
|
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
|
# 4xx Columns
|
||||||
|
|
||||||
# 5xx Colors
|
# 5xx Colors
|
||||||
|
|
34
src/Mod.cpp
34
src/Mod.cpp
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Mod::Mod ()
|
Mod::Mod ()
|
||||||
: std::string ("")
|
: std::string ("") // i18n: no
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Mod::Mod (const char* other)
|
||||||
: std::string (other)
|
: std::string (other)
|
||||||
{
|
{
|
||||||
if (!valid ())
|
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)
|
: std::string (other)
|
||||||
{
|
{
|
||||||
if (!valid ())
|
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 ()
|
bool Mod::valid ()
|
||||||
{
|
{
|
||||||
if (*this == "before" || *this == "after" ||
|
if (*this == "before" || *this == "after" || // i18n: TODO
|
||||||
*this == "not" ||
|
*this == "not" || // i18n: TODO
|
||||||
*this == "none" || *this == "any" ||
|
*this == "none" || *this == "any" || // i18n: TODO
|
||||||
*this == "synth" ||
|
*this == "synth" || // i18n: TODO
|
||||||
*this == "under" || *this == "over" ||
|
*this == "under" || *this == "over" || // i18n: TODO
|
||||||
*this == "first" || *this == "last" ||
|
*this == "first" || *this == "last" || // i18n: TODO
|
||||||
*this == "this" ||
|
*this == "this" || // i18n: TODO
|
||||||
*this == "next" ||
|
*this == "next" || // i18n: TODO
|
||||||
*this == "is" || *this == "isnt" ||
|
*this == "is" || *this == "isnt" || // i18n: TODO
|
||||||
*this == "has" || *this == "hasnt" ||
|
*this == "has" || *this == "hasnt" || // i18n: TODO
|
||||||
*this == "startswith" || *this == "endswith")
|
*this == "startswith" || *this == "endswith") // i18n: TODO
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -77,7 +77,7 @@ bool Mod::valid ()
|
||||||
bool Mod::eval (const Mod& other)
|
bool Mod::eval (const Mod& other)
|
||||||
{
|
{
|
||||||
// No modifier means automatic pass.
|
// No modifier means automatic pass.
|
||||||
if (*this == "")
|
if (*this == "") // i18n: no
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// TODO before
|
// TODO before
|
||||||
|
@ -93,10 +93,10 @@ bool Mod::eval (const Mod& other)
|
||||||
// TODO this
|
// TODO this
|
||||||
// TODO next
|
// TODO next
|
||||||
|
|
||||||
if (*this == ".is")
|
if (*this == "is") // i18n: TODO
|
||||||
return *this == other ? true : false;
|
return *this == other ? true : false;
|
||||||
|
|
||||||
if (*this == ".isnt")
|
if (*this == "isnt") // i18n: TODO
|
||||||
return *this != other ? true : false;
|
return *this != other ? true : false;
|
||||||
|
|
||||||
// TODO has
|
// TODO has
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue