Set all custom failsafe channels at once (#5834)
[opentx.git] / radio / src / translations / tts_de.cpp
blobd54ebe5d5df27ed5ea883435f3ec870a373b25a9
1 /*
2 * Authors (alphabetical order)
3 * - Andre Bernet <bernet.andre@gmail.com>
4 * - Andreas Weitl <andreas.weitl@gmx.de>
5 * - Bertrand Songis <bsongis@gmail.com>
6 * - Benjamin Boy <rcbebo82@googlemail.com>
7 * - Thomas Husterer
9 * opentx is based on code named
10 * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
11 * er9x by Erez Raviv: http://code.google.com/p/er9x/,
12 * and the original (and ongoing) project by
13 * Thomas Husterer, th9x: http://code.google.com/p/th9x/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
26 #include "opentx.h"
28 enum GermanPrompts {
29 DE_PROMPT_NUMBERS_BASE = 0,
30 DE_PROMPT_NULL = DE_PROMPT_NUMBERS_BASE+0,
31 DE_PROMPT_EIN = DE_PROMPT_NUMBERS_BASE+100,
32 DE_PROMPT_EINE = DE_PROMPT_NUMBERS_BASE+101,
33 DE_PROMPT_HUNDERT = DE_PROMPT_NUMBERS_BASE+102,
34 DE_PROMPT_TAUSEND = DE_PROMPT_NUMBERS_BASE+103,
35 DE_PROMPT_COMMA = 104,
36 DE_PROMPT_UND,
37 DE_PROMPT_MINUS,
38 DE_PROMPT_UHR,
39 DE_PROMPT_MINUTE,
40 DE_PROMPT_MINUTEN,
41 DE_PROMPT_SEKUNDE,
42 DE_PROMPT_SEKUNDEN,
43 DE_PROMPT_STUNDE,
44 DE_PROMPT_STUNDEN,
46 DE_PROMPT_UNITS_BASE = 114,
47 DE_PROMPT_VOLTS = DE_PROMPT_UNITS_BASE+UNIT_VOLTS,
48 DE_PROMPT_AMPS = DE_PROMPT_UNITS_BASE+UNIT_AMPS,
49 DE_PROMPT_METERS_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
50 DE_PROMPT_SPARE1 = DE_PROMPT_UNITS_BASE+UNIT_RAW,
51 DE_PROMPT_KMH = DE_PROMPT_UNITS_BASE+UNIT_SPEED,
52 DE_PROMPT_METERS = DE_PROMPT_UNITS_BASE+UNIT_DIST,
53 DE_PROMPT_DEGREES = DE_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
54 DE_PROMPT_PERCENT = DE_PROMPT_UNITS_BASE+UNIT_PERCENT,
55 DE_PROMPT_MILLIAMPS = DE_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
56 DE_PROMPT_MAH = DE_PROMPT_UNITS_BASE+UNIT_MAH,
57 DE_PROMPT_WATTS = DE_PROMPT_UNITS_BASE+UNIT_WATTS,
58 DE_PROMPT_FEET = DE_PROMPT_UNITS_BASE+UNIT_FEET,
59 DE_PROMPT_KTS = DE_PROMPT_UNITS_BASE+UNIT_KTS,
60 DE_PROMPT_HOURS = DE_PROMPT_UNITS_BASE+UNIT_HOURS,
61 DE_PROMPT_MINUTES = DE_PROMPT_UNITS_BASE+UNIT_MINUTES,
62 DE_PROMPT_SECONDS = DE_PROMPT_UNITS_BASE+UNIT_SECONDS,
63 DE_PROMPT_RPMS = DE_PROMPT_UNITS_BASE+UNIT_RPMS,
64 DE_PROMPT_G = DE_PROMPT_UNITS_BASE+UNIT_G,
65 #if defined(CPUARM)
66 DE_PROMPT_MILLILITERS = DE_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
67 DE_PROMPT_FLOZ = DE_PROMPT_UNITS_BASE+UNIT_FLOZ,
68 DE_PROMPT_FEET_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
69 #endif
73 #if defined(VOICE)
74 #if defined(CPUARM)
75 #define DE_PUSH_UNIT_PROMPT(u) de_pushUnitPrompt((u), id)
76 #else
77 #define DE_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
78 #endif
80 I18N_PLAY_FUNCTION(de, pushUnitPrompt, uint8_t unitprompt)
82 #if defined(CPUARM)
83 PUSH_UNIT_PROMPT(unitprompt, 0);
84 #else
85 unitprompt = DE_PROMPT_UNITS_BASE + unitprompt*2
86 PUSH_NUMBER_PROMPT(unitprompt);
87 #endif
90 I18N_PLAY_FUNCTION(de, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
92 /* if digit >= 1000000000:
93 temp_digit, digit = divmod(digit, 1000000000)
94 prompts.extend(self.getNumberPrompt(temp_digit))
95 prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
96 if digit >= 1000000:
97 temp_digit, digit = divmod(digit, 1000000)
98 prompts.extend(self.getNumberPrompt(temp_digit))
99 prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
102 if (number < 0) {
103 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS);
104 number = -number;
107 #if !defined(CPUARM)
108 if (unit) {
109 unit--;
110 convertUnit(number, unit);
111 if (IS_IMPERIAL_ENABLE()) {
112 if (unit == UNIT_DIST) {
113 unit = UNIT_FEET;
115 if (unit == UNIT_SPEED) {
116 unit = UNIT_KTS;
119 unit++;
121 #endif
123 int8_t mode = MODE(att);
124 if (mode > 0) {
125 #if defined(CPUARM)
126 if (mode == 2) {
127 number /= 10;
129 #else
130 // we assume that we are PREC1
131 #endif
132 div_t qr = div((int)number, 10);
133 if (qr.rem > 0) {
134 PUSH_NUMBER_PROMPT(qr.quot);
135 PUSH_NUMBER_PROMPT(DE_PROMPT_COMMA);
136 PUSH_NUMBER_PROMPT(qr.rem);
138 else {
139 if (qr.quot == 1) {
140 PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
142 else {
143 PUSH_NUMBER_PROMPT(qr.quot);
146 DE_PUSH_UNIT_PROMPT(unit);
147 return;
150 if (number >= 2000) {
151 PLAY_NUMBER(number / 1000, 0, 0);
152 PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND);
153 number %= 1000;
154 if (number == 0)
155 number = -1;
158 if ((number >= 1000) && (number < 2000)) {
159 PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
160 PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND);
161 number %= 1000;
162 if (number == 0)
163 number = -1;
166 if ((number >= 200) && (number < 1000)) {
167 PUSH_NUMBER_PROMPT(DE_PROMPT_NULL + number / 100);
168 PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT);
169 number %= 100;
170 if (number == 0)
171 number = -1;
174 if ((number >= 100) && (number < 200)) {
175 PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
176 PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT);
177 number %= 100;
178 if (number == 0)
179 number = -1;
182 if (number >= 0) {
183 PUSH_NUMBER_PROMPT(DE_PROMPT_NULL + number / 1);
186 if (unit) {
187 DE_PUSH_UNIT_PROMPT(unit);
191 I18N_PLAY_FUNCTION(de, playDuration, int seconds PLAY_DURATION_ATT)
193 if (seconds < 0) {
194 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS);
195 seconds = -seconds;
198 uint8_t tmp = seconds / 3600;
199 seconds %= 3600;
201 if (tmp > 0 || IS_PLAY_TIME()) {
202 if (tmp > 1) {
203 PLAY_NUMBER(tmp, 0, 0);
204 PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDEN);
206 else {
207 PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
208 PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDE);
210 if (seconds > 0) {
211 PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
215 tmp = seconds / 60;
216 seconds %= 60;
218 if (tmp > 0) {
219 if (tmp > 1) {
220 PLAY_NUMBER(tmp, 0, 0);
221 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTEN);
223 else {
224 PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
225 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTE);
227 if (seconds > 0) {
228 PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
232 if (seconds > 1) {
233 PLAY_NUMBER(seconds, 0, 0);
234 PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDEN);
236 else {
237 if (seconds == 1) {
238 PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
239 PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDE);
244 LANGUAGE_PACK_DECLARE(de, "Deutsch");
246 #endif