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 PL_PROMPT_NUMBERS_BASE
= 0,
27 PL_PROMPT_ZERO
= PL_PROMPT_NUMBERS_BASE
+0, //0-99
28 PL_PROMPT_STO
= PL_PROMPT_NUMBERS_BASE
+100, //100,200 .. 900
29 PL_PROMPT_TYSIAC
= PL_PROMPT_NUMBERS_BASE
+109, //1000
30 PL_PROMPT_TYSIACE
= PL_PROMPT_NUMBERS_BASE
+110,
31 PL_PROMPT_TYSIECY
= PL_PROMPT_NUMBERS_BASE
+111,
32 PL_PROMPT_JEDNA
= PL_PROMPT_NUMBERS_BASE
+112,
33 PL_PROMPT_JEDNO
= PL_PROMPT_NUMBERS_BASE
+113,
34 PL_PROMPT_DWIE
= PL_PROMPT_NUMBERS_BASE
+114,
35 PL_PROMPT_CALA
= PL_PROMPT_NUMBERS_BASE
+115,
36 PL_PROMPT_CALE
= PL_PROMPT_NUMBERS_BASE
+116,
37 PL_PROMPT_CALYCH
= PL_PROMPT_NUMBERS_BASE
+117,
38 PL_PROMPT_MINUS
= PL_PROMPT_NUMBERS_BASE
+118,
39 PL_PROMPT_DZIESIATKI_ZENSKIE
=PL_PROMPT_NUMBERS_BASE
+120, // 22(0122.wav),32(123.wav),42,52,62,72,82,92(129.wav) - this are special female numbers when the unit is female
41 PL_PROMPT_UNITS_BASE
= 160,
42 PL_PROMPT_VOLTS
= PL_PROMPT_UNITS_BASE
+UNIT_VOLTS
, //(jeden)wolt,(dwa)wolty,(piec+)woltów i tak dla wszytkich unitów
43 PL_PROMPT_AMPS
= PL_PROMPT_UNITS_BASE
+(UNIT_AMPS
*4),
44 PL_PROMPT_METERS_PER_SECOND
= PL_PROMPT_UNITS_BASE
+(UNIT_METERS_PER_SECOND
*4),
45 PL_PROMPT_SPARE1
= PL_PROMPT_UNITS_BASE
+(UNIT_RAW
*4),
46 PL_PROMPT_KMH
= PL_PROMPT_UNITS_BASE
+(UNIT_SPEED
*4),
47 PL_PROMPT_METERS
= PL_PROMPT_UNITS_BASE
+(UNIT_DIST
*4),
48 PL_PROMPT_DEGREES
= PL_PROMPT_UNITS_BASE
+(UNIT_TEMPERATURE
*4),
49 PL_PROMPT_PERCENT
= PL_PROMPT_UNITS_BASE
+(UNIT_PERCENT
*4),
50 PL_PROMPT_MILLIAMPS
= PL_PROMPT_UNITS_BASE
+(UNIT_MILLIAMPS
*4),
51 PL_PROMPT_MAH
= PL_PROMPT_UNITS_BASE
+(UNIT_MAH
*4),
52 PL_PROMPT_WATTS
= PL_PROMPT_UNITS_BASE
+(UNIT_WATTS
*4),
53 PL_PROMPT_DB
= PL_PROMPT_UNITS_BASE
+(UNIT_DB
*4),
54 PL_PROMPT_FEET
= PL_PROMPT_UNITS_BASE
+(UNIT_FEET
*4),
55 PL_PROMPT_KTS
= PL_PROMPT_UNITS_BASE
+(UNIT_KTS
*4),
56 PL_PROMPT_HOURS
= PL_PROMPT_UNITS_BASE
+(UNIT_HOURS
*4),
57 PL_PROMPT_MINUTES
= PL_PROMPT_UNITS_BASE
+(UNIT_MINUTES
*4),
58 PL_PROMPT_SECONDS
= PL_PROMPT_UNITS_BASE
+(UNIT_SECONDS
*4),
59 PL_PROMPT_RPMS
= PL_PROMPT_UNITS_BASE
+(UNIT_RPMS
*4),
60 PL_PROMPT_G
= PL_PROMPT_UNITS_BASE
+(UNIT_G
*4),
62 PL_PROMPT_MILLILITERS
= PL_PROMPT_UNITS_BASE
+(UNIT_MILLILITERS
*4),
63 PL_PROMPT_FLOZ
= PL_PROMPT_UNITS_BASE
+(UNIT_FLOZ
*4),
64 PL_PROMPT_FEET_PER_SECOND
= PL_PROMPT_UNITS_BASE
+(UNIT_FEET_PER_SECOND
*4),
71 #define PL_PUSH_UNIT_PROMPT(u, p) pl_pushUnitPrompt((u), (p), id)
73 #define PL_PUSH_UNIT_PROMPT(u, p) pushUnitPrompt((u), (p))
80 I18N_PLAY_FUNCTION(pl
, pushUnitPrompt
, uint8_t unitprompt
, int16_t number
)
84 PUSH_UNIT_PROMPT(unitprompt
, 0);
85 else if (number
> 1 && number
< 5)
86 PUSH_UNIT_PROMPT(unitprompt
, 1);
91 ten
=(number
- (number
% 10))/10;
92 if ((test_2
> 1 && test_2
< 5) && ten
>=2)
93 PUSH_UNIT_PROMPT(unitprompt
, 1);
95 PUSH_UNIT_PROMPT(unitprompt
, 2);
98 unitprompt
= PL_PROMPT_UNITS_BASE
+ unitprompt
*4;
100 PUSH_NUMBER_PROMPT(unitprompt
);
101 else if (number
> 1 && number
< 5)
102 PUSH_NUMBER_PROMPT(unitprompt
+1);
107 ten
=(number
- (number
% 10))/10;
108 if ((test_2
> 1 && test_2
< 5) && ten
>=2)
109 PUSH_NUMBER_PROMPT(unitprompt
+1);
111 PUSH_NUMBER_PROMPT(unitprompt
+2);
116 I18N_PLAY_FUNCTION(pl
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
120 PUSH_NUMBER_PROMPT(PL_PROMPT_MINUS
);
127 convertUnit(number
, unit
);
128 if (IS_IMPERIAL_ENABLE()) {
129 if (unit
== UNIT_DIST
) {
132 if (unit
== UNIT_SPEED
) {
140 int8_t mode
= MODE(att
);
147 // we assume that we are PREC1
149 div_t qr
= div((int)number
, 10);
151 PLAY_NUMBER(qr
.quot
, 0, ZENSKI
);
153 PUSH_NUMBER_PROMPT(PL_PROMPT_CALA
);
155 PL_PUSH_UNIT_PROMPT(PL_PROMPT_CALA
, qr
.quot
);
156 PLAY_NUMBER(qr
.rem
, 0, ZENSKI
);
157 PUSH_NUMBER_PROMPT(PL_PROMPT_UNITS_BASE
+((unit
-1)*4)+3);
165 int16_t tmp
= number
;
196 if ((number
== 1) && (att
== ZENSKI
)) {
197 PUSH_NUMBER_PROMPT(PL_PROMPT_JEDNA
);
201 if ((number
== 1) && (att
== NIJAKI
)) {
202 PUSH_NUMBER_PROMPT(PL_PROMPT_JEDNO
);
206 if ((number
== 2) && (att
== ZENSKI
)) {
207 PUSH_NUMBER_PROMPT(PL_PROMPT_DWIE
);
211 if (number
>= 1000) {
213 PLAY_NUMBER(number
/ 1000, 0, 0);
215 if (number
>= 2000 && number
< 5000)
216 PUSH_NUMBER_PROMPT(PL_PROMPT_TYSIACE
);
217 else if (number
>= 5000)
218 PUSH_NUMBER_PROMPT(PL_PROMPT_TYSIECY
);
220 PUSH_NUMBER_PROMPT(PL_PROMPT_TYSIAC
);
227 PUSH_NUMBER_PROMPT(PL_PROMPT_STO
+ (number
/100)-1);
237 ten
=(number
- (number
% 10))/10;
238 if (att
== ZENSKI
&& test_2
==2 && ten
>= 2 ) {
240 PUSH_NUMBER_PROMPT(PL_PROMPT_DZIESIATKI_ZENSKIE
+ten
);
242 PUSH_NUMBER_PROMPT(PL_PROMPT_ZERO
+number
);
246 PL_PUSH_UNIT_PROMPT(unit
, tmp
);
251 // The whole funtion has to be changed
252 I18N_PLAY_FUNCTION(pl
, playDuration
, int seconds PLAY_DURATION_ATT
)
255 PUSH_NUMBER_PROMPT(PL_PROMPT_MINUS
);
259 uint8_t tmp
= seconds
/ 3600;
261 if (tmp
> 0 || IS_PLAY_TIME()) {
262 PLAY_NUMBER(tmp
, UNIT_HOURS
, ZENSKI
);
268 PLAY_NUMBER(tmp
, UNIT_MINUTES
, ZENSKI
);
272 PLAY_NUMBER(seconds
, UNIT_SECONDS
, ZENSKI
);
276 LANGUAGE_PACK_DECLARE(pl
, "Polish");