mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
L10N
- Localized Lexer.
This commit is contained in:
parent
beb2ee4d66
commit
3716e61259
6 changed files with 41 additions and 3 deletions
|
@ -24,12 +24,14 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <cmake.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <utf8.h>
|
#include <utf8.h>
|
||||||
#include <ISO8601.h>
|
#include <ISO8601.h>
|
||||||
#include <Date.h>
|
#include <Date.h>
|
||||||
#include <Duration.h>
|
#include <Duration.h>
|
||||||
#include <Lexer.h>
|
#include <Lexer.h>
|
||||||
|
#include <i18n.h>
|
||||||
|
|
||||||
std::string Lexer::dateFormat = "";
|
std::string Lexer::dateFormat = "";
|
||||||
|
|
||||||
|
@ -175,7 +177,7 @@ bool Lexer::token (std::string& result, Type& type)
|
||||||
shift ();
|
shift ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw std::string ("Unexpected error 1");
|
throw std::string (STRING_LEX_IMMEDIATE_UNK);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case typeString:
|
case typeString:
|
||||||
|
@ -384,7 +386,7 @@ bool Lexer::token (std::string& result, Type& type)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw std::string ("Unexpected error 2");
|
throw std::string (STRING_LEX_TYPE_UNK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,7 +513,7 @@ bool Lexer::word (std::string& token, Type& type)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw std::string ("Unexpected error 2");
|
throw std::string (STRING_LEX_TYPE_UNK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,6 +532,7 @@ void Lexer::ambiguity (bool value)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// No L10N - these are for internal purposes.
|
||||||
const std::string Lexer::type_name (const Type& type)
|
const std::string Lexer::type_name (const Type& type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
|
|
@ -175,6 +175,13 @@
|
||||||
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
||||||
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
||||||
|
|
||||||
|
// Lexer
|
||||||
|
//
|
||||||
|
// These are errors generated at the lowest level of input analysis,
|
||||||
|
// at the character level.
|
||||||
|
#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately."
|
||||||
|
#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type."
|
||||||
|
|
||||||
// A3
|
// A3
|
||||||
#define STRING_A3_OVERRIDE_PROBLEM "Problem with override: {1}"
|
#define STRING_A3_OVERRIDE_PROBLEM "Problem with override: {1}"
|
||||||
#define STRING_A3_MISMATCHED_PARENS "Mismatched parentheses in expression"
|
#define STRING_A3_MISMATCHED_PARENS "Mismatched parentheses in expression"
|
||||||
|
|
|
@ -175,6 +175,13 @@
|
||||||
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
||||||
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
||||||
|
|
||||||
|
// Lexer
|
||||||
|
//
|
||||||
|
// These are errors generated at the lowest level of input analysis,
|
||||||
|
// at the character level.
|
||||||
|
#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately."
|
||||||
|
#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type."
|
||||||
|
|
||||||
// A3
|
// A3
|
||||||
// Sobrescritura: de R.A.E. sobrescribir
|
// Sobrescritura: de R.A.E. sobrescribir
|
||||||
#define STRING_A3_OVERRIDE_PROBLEM "Problema con sobrescritura: {1}"
|
#define STRING_A3_OVERRIDE_PROBLEM "Problema con sobrescritura: {1}"
|
||||||
|
|
|
@ -175,6 +175,13 @@
|
||||||
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
||||||
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
||||||
|
|
||||||
|
// Lexer
|
||||||
|
//
|
||||||
|
// These are errors generated at the lowest level of input analysis,
|
||||||
|
// at the character level.
|
||||||
|
#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately."
|
||||||
|
#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type."
|
||||||
|
|
||||||
// A3
|
// A3
|
||||||
#define STRING_A3_OVERRIDE_PROBLEM "Problème avec l'écrasement de {1}"
|
#define STRING_A3_OVERRIDE_PROBLEM "Problème avec l'écrasement de {1}"
|
||||||
#define STRING_A3_MISMATCHED_PARENS "Parenthèses incohérentes dans l'expression"
|
#define STRING_A3_MISMATCHED_PARENS "Parenthèses incohérentes dans l'expression"
|
||||||
|
|
|
@ -176,6 +176,13 @@
|
||||||
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
||||||
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
||||||
|
|
||||||
|
// Lexer
|
||||||
|
//
|
||||||
|
// These are errors generated at the lowest level of input analysis,
|
||||||
|
// at the character level.
|
||||||
|
#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately."
|
||||||
|
#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type."
|
||||||
|
|
||||||
// A3
|
// A3
|
||||||
#define STRING_A3_OVERRIDE_PROBLEM "Problema di modifica: {1}"
|
#define STRING_A3_OVERRIDE_PROBLEM "Problema di modifica: {1}"
|
||||||
#define STRING_A3_MISMATCHED_PARENS "Mancata corrispondenza nell'uso delle parentesi nell'espressione"
|
#define STRING_A3_MISMATCHED_PARENS "Mancata corrispondenza nell'uso delle parentesi nell'espressione"
|
||||||
|
|
|
@ -175,6 +175,13 @@
|
||||||
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
#define STRING_VARIANT_SQRT_NEG "Cannot take the square root of a negative number."
|
||||||
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
#define STRING_VARIANT_COERCE_UNK "Cannot coerce data either to or from an unknown type"
|
||||||
|
|
||||||
|
// Lexer
|
||||||
|
//
|
||||||
|
// These are errors generated at the lowest level of input analysis,
|
||||||
|
// at the character level.
|
||||||
|
#define STRING_LEX_IMMEDIATE_UNK "Lexer start failure, unknown characters found immediately."
|
||||||
|
#define STRING_LEX_TYPE_UNK "Lexer cannot process and unknown token type."
|
||||||
|
|
||||||
// A3
|
// A3
|
||||||
#define STRING_A3_OVERRIDE_PROBLEM "Problema com a alteração: {1}"
|
#define STRING_A3_OVERRIDE_PROBLEM "Problema com a alteração: {1}"
|
||||||
#define STRING_A3_MISMATCHED_PARENS "Erro de não correspondência de parentesis na expressão"
|
#define STRING_A3_MISMATCHED_PARENS "Erro de não correspondência de parentesis na expressão"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue