2 * Authors (alphabetical order)
3 * - Andre Bernet <bernet.andre@gmail.com>
5 * - Bertrand Songis <bsongis@gmail.com>
6 * - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
7 * - Cameron Weeks <th9xer@gmail.com>
10 * - Jean-Pierre Parisy
17 * - Romolo Manfredini <romolo.manfredini@gmail.com>
20 * opentx is based on code named
21 * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
22 * er9x by Erez Raviv: http://code.google.com/p/er9x/,
23 * and the original (and ongoing) project by
24 * Thomas Husterer, th9x: http://code.google.com/p/th9x/
26 * This program is free software; you can redistribute it and/or modify
27 * it under the terms of the GNU General Public License version 2 as
28 * published by the Free Software Foundation.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
39 enum PortuguesePrompts
{
40 PT_PROMPT_NUMBERS_BASE
= 0,
41 PT_PROMPT_ZERO
= PT_PROMPT_NUMBERS_BASE
+0,
42 PT_PROMPT_CEM
= PT_PROMPT_NUMBERS_BASE
+100,
43 PT_PROMPT_CENTO
= PT_PROMPT_NUMBERS_BASE
+101,
44 PT_PROMPT_DUZENTOS
= PT_PROMPT_NUMBERS_BASE
+102,
46 PT_PROMPT_QUATROCENTOS
,
51 PT_PROMPT_NUEVECENTOS
,
52 PT_PROMPT_MIL
= PT_PROMPT_NUMBERS_BASE
+110,
53 PT_PROMPT_VIRGULA
= 111,
65 PT_PROMPT_UNITS_BASE
= 122,
66 PT_PROMPT_VOLTS
= PT_PROMPT_UNITS_BASE
+UNIT_VOLTS
,
67 PT_PROMPT_AMPS
= PT_PROMPT_UNITS_BASE
+UNIT_AMPS
,
68 PT_PROMPT_METERS_PER_SECOND
= PT_PROMPT_UNITS_BASE
+UNIT_METERS_PER_SECOND
,
69 PT_PROMPT_SPARE1
= PT_PROMPT_UNITS_BASE
+UNIT_RAW
,
70 PT_PROMPT_KMH
= PT_PROMPT_UNITS_BASE
+UNIT_SPEED
,
71 PT_PROMPT_METERS
= PT_PROMPT_UNITS_BASE
+UNIT_DIST
,
72 PT_PROMPT_DEGREES
= PT_PROMPT_UNITS_BASE
+UNIT_TEMPERATURE
,
73 PT_PROMPT_PERCENT
= PT_PROMPT_UNITS_BASE
+UNIT_PERCENT
,
74 PT_PROMPT_MILLIAMPS
= PT_PROMPT_UNITS_BASE
+UNIT_MILLIAMPS
,
75 PT_PROMPT_MAH
= PT_PROMPT_UNITS_BASE
+UNIT_MAH
,
76 PT_PROMPT_WATTS
= PT_PROMPT_UNITS_BASE
+UNIT_WATTS
,
77 PT_PROMPT_FEET
= PT_PROMPT_UNITS_BASE
+UNIT_FEET
,
78 PT_PROMPT_KTS
= PT_PROMPT_UNITS_BASE
+UNIT_KTS
,
80 PT_PROMPT_MILLILITERS
= PT_PROMPT_UNITS_BASE
+UNIT_MILLILITERS
,
81 PT_PROMPT_FLOZ
= PT_PROMPT_UNITS_BASE
+UNIT_FLOZ
,
82 PT_PROMPT_FEET_PER_SECOND
= PT_PROMPT_UNITS_BASE
+UNIT_FEET_PER_SECOND
,
89 #define PT_PUSH_UNIT_PROMPT(u) pt_pushUnitPrompt((u), id)
91 #define PT_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
94 I18N_PLAY_FUNCTION(pt
, pushUnitPrompt
, uint8_t unitprompt
)
97 PUSH_UNIT_PROMPT(unitprompt
, 0);
99 unitprompt
= PT_PROMPT_UNITS_BASE
+ unitprompt
*2;
100 PUSH_NUMBER_PROMPT(unitprompt
);
104 I18N_PLAY_FUNCTION(pt
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
107 PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS
);
114 convertUnit(number
, unit
);
115 if (IS_IMPERIAL_ENABLE()) {
116 if (unit
== UNIT_DIST
) {
119 if (unit
== UNIT_SPEED
) {
127 int8_t mode
= MODE(att
);
134 // we assume that we are PREC1
136 div_t qr
= div((int)number
, 10);
138 PLAY_NUMBER(qr
.quot
, 0, 0);
139 PUSH_NUMBER_PROMPT(PT_PROMPT_VIRGULA
);
140 if (mode
==2 && qr
.rem
< 10)
141 PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO
);
142 PLAY_NUMBER(qr
.rem
, unit
, 0);
145 PLAY_NUMBER(qr
.quot
, unit
, 0);
150 if (number
>= 1000) {
151 if (number
>= 2000) {
152 PLAY_NUMBER(number
/ 1000, 0, 0);
153 PUSH_NUMBER_PROMPT(PT_PROMPT_MIL
);
155 PUSH_NUMBER_PROMPT(PT_PROMPT_MIL
);
162 PUSH_NUMBER_PROMPT(PT_PROMPT_CENTO
+ number
/100);
167 PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO
+number
);
170 PT_PUSH_UNIT_PROMPT(unit
);
174 I18N_PLAY_FUNCTION(pt
, playDuration
, int seconds PLAY_DURATION_ATT
)
177 PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS
);
182 uint8_t tmp
= seconds
/ 3600;
184 if (tmp
> 0 || IS_PLAY_TIME()) {
187 PLAY_NUMBER(tmp
, 0, 0);
189 PUSH_UNIT_PROMPT(UNIT_HOURS
, 1);
191 PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS
);
194 PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS
);
196 PUSH_UNIT_PROMPT(UNIT_HOURS
, 1);
198 PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS
);
201 PUSH_NUMBER_PROMPT(PT_PROMPT_UMA
);
203 PUSH_UNIT_PROMPT(UNIT_HOURS
, 0);
205 PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS
);
212 if (tmp
> 0 || ore
>0) {
214 PLAY_NUMBER(tmp
, 0, 0);
216 PUSH_UNIT_PROMPT(UNIT_MINUTES
, 1);
218 PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTOS
);
221 PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE
+1);
223 PUSH_UNIT_PROMPT(UNIT_MINUTES
, 0);
225 PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTO
);
228 PUSH_NUMBER_PROMPT(PT_PROMPT_E
);
232 PLAY_NUMBER(seconds
, 0, 0);
234 PUSH_UNIT_PROMPT(UNIT_SECONDS
, 1);
236 PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDOS
);
239 PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE
+1);
241 PUSH_UNIT_PROMPT(UNIT_SECONDS
, 0);
243 PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDO
);
248 LANGUAGE_PACK_DECLARE(pt
, "Portugues");