2 * Authors (alphabetical order)
3 * - Bertrand Songis <bsongis@gmail.com>
4 * - Martin Hotar <mhotar@gmail.com>
6 * opentx is based on code named
7 * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
8 * er9x by Erez Raviv: http://code.google.com/p/er9x/,
9 * and the original (and ongoing) project by
10 * Thomas Husterer, th9x: http://code.google.com/p/th9x/
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
26 CZ_PROMPT_NUMBERS_BASE
= 0,
27 CZ_PROMPT_NULA
= CZ_PROMPT_NUMBERS_BASE
+0, // 0-99
28 CZ_PROMPT_STO
= CZ_PROMPT_NUMBERS_BASE
+100, // 100,200 .. 900
29 CZ_PROMPT_TISIC
= CZ_PROMPT_NUMBERS_BASE
+109, // 1000
30 CZ_PROMPT_TISICE
= CZ_PROMPT_NUMBERS_BASE
+110,
31 CZ_PROMPT_JEDEN
= CZ_PROMPT_NUMBERS_BASE
+111,
32 CZ_PROMPT_JEDNO
= CZ_PROMPT_NUMBERS_BASE
+112,
33 CZ_PROMPT_DVE
= CZ_PROMPT_NUMBERS_BASE
+113,
34 CZ_PROMPT_CELA
= CZ_PROMPT_NUMBERS_BASE
+114,
35 CZ_PROMPT_CELE
= CZ_PROMPT_NUMBERS_BASE
+115,
36 CZ_PROMPT_CELYCH
= CZ_PROMPT_NUMBERS_BASE
+116,
37 CZ_PROMPT_MINUS
= CZ_PROMPT_NUMBERS_BASE
+117,
39 CZ_PROMPT_UNITS_BASE
= 118, // (jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu
45 #define CZ_PUSH_UNIT_PROMPT(u, p) cz_pushUnitPrompt((u), (p), id)
47 #define CZ_PUSH_UNIT_PROMPT(u, p) pushUnitPrompt((u), (p))
54 I18N_PLAY_FUNCTION(cz
, pushUnitPrompt
, uint8_t unit
, int16_t number
)
57 TRACE("CZSAY unit:%d number:%d", unit
, number
);
59 PUSH_UNIT_PROMPT(unit
, 0);
60 else if (number
> 1 && number
< 5)
61 PUSH_UNIT_PROMPT(unit
, 1);
63 PUSH_UNIT_PROMPT(unit
, 2);
65 unitprompt
= CZ_PROMPT_UNITS_BASE
+((unit
-1)*4);
67 PUSH_NUMBER_PROMPT(unit
);
68 else if (number
> 1 && number
< 5)
69 PUSH_NUMBER_PROMPT(unit
+1);
71 PUSH_NUMBER_PROMPT(unit
+2);
75 I18N_PLAY_FUNCTION(cz
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
78 PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS
);
85 convertUnit(number
, unit
);
86 if (IS_IMPERIAL_ENABLE()) {
87 if (unit
== UNIT_DIST
) {
90 if (unit
== UNIT_SPEED
) {
98 int8_t mode
= MODE(att
);
105 // we assume that we are PREC1
107 div_t qr
= div((int)number
, 10);
109 PLAY_NUMBER(qr
.quot
, 0, FEMALE
);
111 PUSH_NUMBER_PROMPT(CZ_PROMPT_CELA
);
113 else if (qr
.quot
> 1 && qr
.quot
< 5) {
114 PUSH_NUMBER_PROMPT(CZ_PROMPT_CELE
);
117 PUSH_NUMBER_PROMPT(CZ_PROMPT_CELYCH
);
119 PLAY_NUMBER(qr
.rem
, 0, FEMALE
);
121 PUSH_UNIT_PROMPT(unit
, 3);
123 PUSH_NUMBER_PROMPT(CZ_PROMPT_UNITS_BASE
+((unit
-1)*4)+3);
132 int16_t tmp
= number
;
136 case UNIT_FEET_PER_SECOND
:
156 if ((number
== 1) && (att
== MALE
)) {
157 PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDEN
);
161 if ((number
== 1) && (att
== NEUTRAL
)) {
162 PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDNO
);
166 if ((number
== 2) && ((att
== FEMALE
) || (att
== NEUTRAL
))) {
167 PUSH_NUMBER_PROMPT(CZ_PROMPT_DVE
);
171 if (number
>= 1000) {
173 PLAY_NUMBER(number
/ 1000, 0, 0);
174 if (number
>= 2000 && number
< 5000)
175 PUSH_NUMBER_PROMPT(CZ_PROMPT_TISICE
);
177 PUSH_NUMBER_PROMPT(CZ_PROMPT_TISIC
);
183 PUSH_NUMBER_PROMPT(CZ_PROMPT_STO
+ (number
/100)-1);
190 PUSH_NUMBER_PROMPT(CZ_PROMPT_NULA
+number
);
194 CZ_PUSH_UNIT_PROMPT(unit
, tmp
);
198 I18N_PLAY_FUNCTION(cz
, playDuration
, int seconds PLAY_DURATION_ATT
)
201 PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS
);
205 uint8_t tmp
= seconds
/ 3600;
207 if (tmp
> 0 || IS_PLAY_TIME()) {
208 PLAY_NUMBER(tmp
, UNIT_HOURS
, FEMALE
);
214 PLAY_NUMBER(tmp
, UNIT_MINUTES
, FEMALE
);
218 PLAY_NUMBER(seconds
, UNIT_SECONDS
, FEMALE
);
222 LANGUAGE_PACK_DECLARE(cz
, "Czech");