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
,
79 PT_PROMPT_MILLILITERS
= PT_PROMPT_UNITS_BASE
+UNIT_MILLILITERS
,
80 PT_PROMPT_FLOZ
= PT_PROMPT_UNITS_BASE
+UNIT_FLOZ
,
81 PT_PROMPT_FEET_PER_SECOND
= PT_PROMPT_UNITS_BASE
+UNIT_FEET_PER_SECOND
,
85 #define PT_PUSH_UNIT_PROMPT(u) pt_pushUnitPrompt((u), id)
87 I18N_PLAY_FUNCTION(pt
, pushUnitPrompt
, uint8_t unitprompt
)
89 PUSH_UNIT_PROMPT(unitprompt
, 0);
92 I18N_PLAY_FUNCTION(pt
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
95 PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS
);
100 int8_t mode
= MODE(att
);
105 div_t qr
= div((int)number
, 10);
107 PLAY_NUMBER(qr
.quot
, 0, 0);
108 PUSH_NUMBER_PROMPT(PT_PROMPT_VIRGULA
);
109 if (mode
==2 && qr
.rem
< 10)
110 PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO
);
111 PLAY_NUMBER(qr
.rem
, unit
, 0);
114 PLAY_NUMBER(qr
.quot
, unit
, 0);
119 if (number
>= 1000) {
120 if (number
>= 2000) {
121 PLAY_NUMBER(number
/ 1000, 0, 0);
122 PUSH_NUMBER_PROMPT(PT_PROMPT_MIL
);
124 PUSH_NUMBER_PROMPT(PT_PROMPT_MIL
);
131 PUSH_NUMBER_PROMPT(PT_PROMPT_CENTO
+ number
/100);
136 PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO
+number
);
139 PT_PUSH_UNIT_PROMPT(unit
);
143 I18N_PLAY_FUNCTION(pt
, playDuration
, int seconds PLAY_DURATION_ATT
)
146 PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS
);
151 uint8_t tmp
= seconds
/ 3600;
153 if (tmp
> 0 || IS_PLAY_TIME()) {
156 PLAY_NUMBER(tmp
, 0, 0);
157 PUSH_UNIT_PROMPT(UNIT_HOURS
, 1);
159 PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS
);
160 PUSH_UNIT_PROMPT(UNIT_HOURS
, 1);
162 PUSH_NUMBER_PROMPT(PT_PROMPT_UMA
);
163 PUSH_UNIT_PROMPT(UNIT_HOURS
, 0);
169 if (tmp
> 0 || ore
>0) {
171 PLAY_NUMBER(tmp
, 0, 0);
172 PUSH_UNIT_PROMPT(UNIT_MINUTES
, 1);
174 PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE
+1);
175 PUSH_UNIT_PROMPT(UNIT_MINUTES
, 0);
177 PUSH_NUMBER_PROMPT(PT_PROMPT_E
);
181 PLAY_NUMBER(seconds
, 0, 0);
182 PUSH_UNIT_PROMPT(UNIT_SECONDS
, 1);
184 PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE
+1);
185 PUSH_UNIT_PROMPT(UNIT_SECONDS
, 0);
189 LANGUAGE_PACK_DECLARE(pt
, "Portugues");