10#include "../core/enum_type.hpp"
21typedef void (*ParseCmdProc)(
Buffer *buffer,
char *buf,
int value);
28 int8_t default_plural_offset;
32extern void EmitSingleChar(
Buffer *buffer,
char *buf,
int value);
33extern void EmitPlural(
Buffer *buffer,
char *buf,
int value);
34extern void EmitGender(
Buffer *buffer,
char *buf,
int value);
44 {
"BLUE", EmitSingleChar, SCC_BLUE, 0, -1,
C_DONTCOUNT},
45 {
"SILVER", EmitSingleChar, SCC_SILVER, 0, -1,
C_DONTCOUNT},
46 {
"GOLD", EmitSingleChar, SCC_GOLD, 0, -1,
C_DONTCOUNT},
47 {
"RED", EmitSingleChar, SCC_RED, 0, -1,
C_DONTCOUNT},
48 {
"PURPLE", EmitSingleChar, SCC_PURPLE, 0, -1,
C_DONTCOUNT},
49 {
"LTBROWN", EmitSingleChar, SCC_LTBROWN, 0, -1,
C_DONTCOUNT},
50 {
"ORANGE", EmitSingleChar, SCC_ORANGE, 0, -1,
C_DONTCOUNT},
51 {
"GREEN", EmitSingleChar, SCC_GREEN, 0, -1,
C_DONTCOUNT},
52 {
"YELLOW", EmitSingleChar, SCC_YELLOW, 0, -1,
C_DONTCOUNT},
53 {
"DKGREEN", EmitSingleChar, SCC_DKGREEN, 0, -1,
C_DONTCOUNT},
54 {
"CREAM", EmitSingleChar, SCC_CREAM, 0, -1,
C_DONTCOUNT},
55 {
"BROWN", EmitSingleChar, SCC_BROWN, 0, -1,
C_DONTCOUNT},
56 {
"WHITE", EmitSingleChar, SCC_WHITE, 0, -1,
C_DONTCOUNT},
57 {
"LTBLUE", EmitSingleChar, SCC_LTBLUE, 0, -1,
C_DONTCOUNT},
58 {
"GRAY", EmitSingleChar, SCC_GRAY, 0, -1,
C_DONTCOUNT},
59 {
"DKBLUE", EmitSingleChar, SCC_DKBLUE, 0, -1,
C_DONTCOUNT},
60 {
"BLACK", EmitSingleChar, SCC_BLACK, 0, -1,
C_DONTCOUNT},
61 {
"COLOUR", EmitSingleChar, SCC_COLOUR, 1, -1,
C_NONE},
62 {
"PUSH_COLOUR", EmitSingleChar, SCC_PUSH_COLOUR, 0, -1,
C_DONTCOUNT},
63 {
"POP_COLOUR", EmitSingleChar, SCC_POP_COLOUR, 0, -1,
C_DONTCOUNT},
65 {
"REV", EmitSingleChar, SCC_REVISION, 0, -1,
C_NONE},
67 {
"STRING1", EmitSingleChar, SCC_STRING1, 2, -1,
C_CASE |
C_GENDER},
68 {
"STRING2", EmitSingleChar, SCC_STRING2, 3, -1,
C_CASE |
C_GENDER},
69 {
"STRING3", EmitSingleChar, SCC_STRING3, 4, -1,
C_CASE |
C_GENDER},
70 {
"STRING4", EmitSingleChar, SCC_STRING4, 5, -1,
C_CASE |
C_GENDER},
71 {
"STRING5", EmitSingleChar, SCC_STRING5, 6, -1,
C_CASE |
C_GENDER},
72 {
"STRING6", EmitSingleChar, SCC_STRING6, 7, -1,
C_CASE |
C_GENDER},
73 {
"STRING7", EmitSingleChar, SCC_STRING7, 8, -1,
C_CASE |
C_GENDER},
75 {
"STATION_FEATURES", EmitSingleChar, SCC_STATION_FEATURES, 1, -1,
C_NONE},
76 {
"INDUSTRY", EmitSingleChar, SCC_INDUSTRY_NAME, 1, -1,
C_CASE |
C_GENDER},
77 {
"CARGO_LONG", EmitSingleChar, SCC_CARGO_LONG, 2, 1,
C_NONE |
C_GENDER},
78 {
"CARGO_SHORT", EmitSingleChar, SCC_CARGO_SHORT, 2, 1,
C_NONE |
C_GENDER},
79 {
"CARGO_TINY", EmitSingleChar, SCC_CARGO_TINY, 2, 1,
C_NONE},
80 {
"CARGO_LIST", EmitSingleChar, SCC_CARGO_LIST, 1, -1,
C_CASE},
81 {
"POWER", EmitSingleChar, SCC_POWER, 1, 0,
C_NONE},
82 {
"POWER_TO_WEIGHT", EmitSingleChar, SCC_POWER_TO_WEIGHT, 1, 0,
C_NONE},
83 {
"VOLUME_LONG", EmitSingleChar, SCC_VOLUME_LONG, 1, 0,
C_NONE},
84 {
"VOLUME_SHORT", EmitSingleChar, SCC_VOLUME_SHORT, 1, 0,
C_NONE},
85 {
"WEIGHT_LONG", EmitSingleChar, SCC_WEIGHT_LONG, 1, 0,
C_NONE},
86 {
"WEIGHT_SHORT", EmitSingleChar, SCC_WEIGHT_SHORT, 1, 0,
C_NONE},
87 {
"FORCE", EmitSingleChar, SCC_FORCE, 1, 0,
C_NONE},
88 {
"VELOCITY", EmitSingleChar, SCC_VELOCITY, 1, 0,
C_NONE},
89 {
"HEIGHT", EmitSingleChar, SCC_HEIGHT, 1, 0,
C_NONE},
91 {
"UNITS_DAYS_OR_SECONDS", EmitSingleChar, SCC_UNITS_DAYS_OR_SECONDS, 1, 0,
C_GENDER},
92 {
"UNITS_MONTHS_OR_MINUTES", EmitSingleChar, SCC_UNITS_MONTHS_OR_MINUTES, 1, 0,
C_GENDER},
93 {
"UNITS_YEARS_OR_PERIODS", EmitSingleChar, SCC_UNITS_YEARS_OR_PERIODS, 1, 0,
C_GENDER},
94 {
"UNITS_YEARS_OR_MINUTES", EmitSingleChar, SCC_UNITS_YEARS_OR_MINUTES, 1, 0,
C_GENDER},
99 {
"DATE_TINY", EmitSingleChar, SCC_DATE_TINY, 1, -1,
C_NONE},
100 {
"DATE_SHORT", EmitSingleChar, SCC_DATE_SHORT, 1, -1,
C_CASE},
101 {
"DATE_LONG", EmitSingleChar, SCC_DATE_LONG, 1, -1,
C_CASE},
102 {
"DATE_ISO", EmitSingleChar, SCC_DATE_ISO, 1, -1,
C_NONE},
105 {
"RAW_STRING", EmitSingleChar, SCC_RAW_STRING_POINTER, 1, -1,
C_NONE |
C_GENDER},
108 {
"COMMA", EmitSingleChar, SCC_COMMA, 1, 0,
C_NONE},
109 {
"DECIMAL", EmitSingleChar, SCC_DECIMAL, 2, 0,
C_NONE},
110 {
"NUM", EmitSingleChar, SCC_NUM, 1, 0,
C_NONE},
111 {
"ZEROFILL_NUM", EmitSingleChar, SCC_ZEROFILL_NUM, 2, 0,
C_NONE},
112 {
"BYTES", EmitSingleChar, SCC_BYTES, 1, 0,
C_NONE},
113 {
"HEX", EmitSingleChar, SCC_HEX, 1, 0,
C_NONE},
115 {
"CURRENCY_LONG", EmitSingleChar, SCC_CURRENCY_LONG, 1, 0,
C_NONE},
116 {
"CURRENCY_SHORT", EmitSingleChar, SCC_CURRENCY_SHORT, 1, 0,
C_NONE},
118 {
"WAYPOINT", EmitSingleChar, SCC_WAYPOINT_NAME, 1, -1,
C_NONE |
C_GENDER},
119 {
"STATION", EmitSingleChar, SCC_STATION_NAME, 1, -1,
C_NONE |
C_GENDER},
120 {
"DEPOT", EmitSingleChar, SCC_DEPOT_NAME, 2, -1,
C_NONE |
C_GENDER},
121 {
"TOWN", EmitSingleChar, SCC_TOWN_NAME, 1, -1,
C_NONE |
C_GENDER},
122 {
"GROUP", EmitSingleChar, SCC_GROUP_NAME, 1, -1,
C_NONE |
C_GENDER},
123 {
"SIGN", EmitSingleChar, SCC_SIGN_NAME, 1, -1,
C_NONE |
C_GENDER},
124 {
"ENGINE", EmitSingleChar, SCC_ENGINE_NAME, 1, -1,
C_NONE |
C_GENDER},
125 {
"VEHICLE", EmitSingleChar, SCC_VEHICLE_NAME, 1, -1,
C_NONE |
C_GENDER},
126 {
"COMPANY", EmitSingleChar, SCC_COMPANY_NAME, 1, -1,
C_NONE |
C_GENDER},
127 {
"COMPANY_NUM", EmitSingleChar, SCC_COMPANY_NUM, 1, -1,
C_NONE},
128 {
"PRESIDENT_NAME", EmitSingleChar, SCC_PRESIDENT_NAME, 1, -1,
C_NONE |
C_GENDER},
130 {
"SPACE", EmitSingleChar,
' ', 0, -1,
C_DONTCOUNT},
133 {
"UP_ARROW", EmitSingleChar, SCC_UP_ARROW, 0, -1,
C_DONTCOUNT},
134 {
"SMALL_UP_ARROW", EmitSingleChar, SCC_SMALL_UP_ARROW, 0, -1,
C_DONTCOUNT},
135 {
"SMALL_DOWN_ARROW", EmitSingleChar, SCC_SMALL_DOWN_ARROW, 0, -1,
C_DONTCOUNT},
136 {
"TRAIN", EmitSingleChar, SCC_TRAIN, 0, -1,
C_DONTCOUNT},
137 {
"LORRY", EmitSingleChar, SCC_LORRY, 0, -1,
C_DONTCOUNT},
138 {
"BUS", EmitSingleChar, SCC_BUS, 0, -1,
C_DONTCOUNT},
139 {
"PLANE", EmitSingleChar, SCC_PLANE, 0, -1,
C_DONTCOUNT},
140 {
"SHIP", EmitSingleChar, SCC_SHIP, 0, -1,
C_DONTCOUNT},
141 {
"NBSP", EmitSingleChar, 0xA0, 0, -1,
C_DONTCOUNT},
142 {
"COPYRIGHT", EmitSingleChar, 0xA9, 0, -1,
C_DONTCOUNT},
143 {
"DOWN_ARROW", EmitSingleChar, SCC_DOWN_ARROW, 0, -1,
C_DONTCOUNT},
144 {
"CHECKMARK", EmitSingleChar, SCC_CHECKMARK, 0, -1,
C_DONTCOUNT},
145 {
"CROSS", EmitSingleChar, SCC_CROSS, 0, -1,
C_DONTCOUNT},
146 {
"RIGHT_ARROW", EmitSingleChar, SCC_RIGHT_ARROW, 0, -1,
C_DONTCOUNT},
147 {
"SMALL_LEFT_ARROW", EmitSingleChar, SCC_LESS_THAN, 0, -1,
C_DONTCOUNT},
148 {
"SMALL_RIGHT_ARROW", EmitSingleChar, SCC_GREATER_THAN, 0, -1,
C_DONTCOUNT},
173 { 2,
"Two forms: special case for 1.",
"\"1\" \"other\"" },
174 { 1,
"Only one form.",
"\"other\"" },
175 { 2,
"Two forms: special case for 0 to 1.",
"\"0..1\" \"other\"" },
176 { 3,
"Three forms: special cases for 0, and numbers ending in 1 except when ending in 11.",
"\"1,21,31,...\" \"other\" \"0\"" },
177 { 5,
"Five forms: special cases for 1, 2, 3 to 6, and 7 to 10.",
"\"1\" \"2\" \"3..6\" \"7..10\" \"other\"" },
178 { 3,
"Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 9 except when ending in 12 to 19.",
"\"1,21,31,...\" \"2..9,22..29,32..39,...\" \"other\"" },
179 { 3,
"Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 4 except when ending in 12 to 14.",
"\"1,21,31,...\" \"2..4,22..24,32..34,...\" \"other\"" },
180 { 3,
"Three forms: special cases for 1, and numbers ending in 2 to 4 except when ending in 12 to 14.",
"\"1\" \"2..4,22..24,32..34,...\" \"other\"" },
181 { 4,
"Four forms: special cases for numbers ending in 01, 02, and 03 to 04.",
"\"1,101,201,...\" \"2,102,202,...\" \"3..4,103..104,203..204,...\" \"other\"" },
182 { 2,
"Two forms: special case for numbers ending in 1 except when ending in 11.",
"\"1,21,31,...\" \"other\"" },
183 { 3,
"Three forms: special cases for 1, and 2 to 4.",
"\"1\" \"2..4\" \"other\"" },
184 { 2,
"Two forms: cases for numbers ending with a consonant, and with a vowel.",
"\"yeong,il,sam,yuk,chil,pal\" \"i,sa,o,gu\"" },
185 { 4,
"Four forms: special cases for 1, 0 and numbers ending in 02 to 10, and numbers ending in 11 to 19.",
"\"1\" \"0,2..10,102..110,202..210,...\" \"11..19,111..119,211..219,...\" \"other\"" },
186 { 4,
"Four forms: special cases for 1 and 11, 2 and 12, 3..10 and 13..19.",
"\"1,11\" \"2,12\" \"3..10,13..19\" \"other\"" },
187 { 3,
"Three forms: special cases for 1, 0 and numbers ending in 01 to 19.",
"\"1\" \"0,2..19,101..119,201..219,...\" \"other\"" },
205 {
"name",
"0",
"",
"English name for the language" },
206 {
"ownname",
"t",
"",
"Localised name for the language" },
207 {
"isocode",
"0",
"",
"ISO code for the language" },
208 {
"plural",
"tp",
"0",
"Plural form to use" },
209 {
"textdir",
"tl",
"ltr",
"Text direction. Either ltr (left-to-right) or rtl (right-to-left)" },
210 {
"digitsep",
"td",
",",
"Digit grouping separator for non-currency numbers" },
211 {
"digitsepcur",
"td",
",",
"Digit grouping separator for currency numbers" },
212 {
"decimalsep",
"td",
".",
"Decimal separator" },
213 {
"winlangid",
"x2",
"0x0000",
"Language ID for Windows" },
214 {
"grflangid",
"x1",
"0x00",
"Language ID for NewGRFs" },
215 {
"gender",
"tag",
"",
"List of genders" },
216 {
"case",
"tac",
"",
"List of cases" },
@ SCC_TINYFONT
Switch to small font.
@ SCC_NORMALFONT
Switch to normal size font.
@ SCC_BIGFONT
Switch to large font.
@ SCC_MONOFONT
Switch to monospaced font.
#define DECLARE_ENUM_AS_BIT_SET(enum_type)
Operators to allow to work with enum as with type safe bit set in C++.
static const int MAX_PLURALS
The maximum number of plurals.
static const char *const _pragmas[][4]
All pragmas used.
static const PluralForm _plural_forms[]
All plural forms used.
@ C_GENDER
These commands support genders.
@ C_CASE
These commands support cases.
@ C_NONE
Nothing special about this command.
@ C_DONTCOUNT
These commands aren't counted for comparison.
static const char32_t CHAR_TD_RLE
The following text is embedded right-to-left.
static const char32_t CHAR_TD_LRO
Force the following characters to be treated as left-to-right characters.
static const char32_t CHAR_TD_LRM
The next character acts like a left-to-right character.
static const char32_t CHAR_TD_RLO
Force the following characters to be treated as right-to-left characters.
static const char32_t CHAR_TD_LRE
The following text is embedded left-to-right.
static const char32_t CHAR_TD_RLM
The next character acts like a right-to-left character.
static const char32_t CHAR_TD_PDF
Restore the text-direction state to before the last LRE, RLE, LRO or RLO.
The buffer for writing a single string.