Fix doc path
[opentx.git] / radio / src / translations / tts_nl.cpp
blob37c6adaea3b6f17cc873b2974f7744797dcc5259
1 /*
2 * Authors (alphabetical order)
3 * - Andre Bernet <bernet.andre@gmail.com>
4 * - Andreas Weitl
5 * - Bertrand Songis <bsongis@gmail.com>
6 * - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
7 * - Cameron Weeks <th9xer@gmail.com>
8 * - Erez Raviv
9 * - Gabriel Birkus
10 * - Jean-Pierre Parisy
11 * - Karl Szmutny
12 * - Michael Blandford
13 * - Michal Hlavinka
14 * - Pat Mackenzie
15 * - Philip Moss
16 * - Rob Thomson
17 * - Romolo Manfredini <romolo.manfredini@gmail.com>
18 * - Thomas Husterer
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.
37 // NOTE: This file is identical to the EN version
39 #include "opentx.h"
41 enum DutchPrompts {
42 NL_PROMPT_NUMBERS_BASE = 0,
43 NL_PROMPT_ZERO = NL_PROMPT_NUMBERS_BASE+0, //02-99
44 NL_PROMPT_HUNDRED = NL_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
45 NL_PROMPT_THOUSAND = NL_PROMPT_NUMBERS_BASE+109, //1000
46 NL_PROMPT_AND = NL_PROMPT_NUMBERS_BASE+110,
47 NL_PROMPT_MINUS = NL_PROMPT_NUMBERS_BASE+111,
48 NL_PROMPT_POINT = NL_PROMPT_NUMBERS_BASE+112,
49 NL_PROMPT_UNITS_BASE = 113,
50 NL_PROMPT_POINT_BASE = 167, //.0 - .9
53 #if defined(VOICE)
55 #if defined(CPUARM)
56 #define NL_PUSH_UNIT_PROMPT(u, p) nl_pushUnitPrompt((u), (p), id)
57 #else
58 #define NL_PUSH_UNIT_PROMPT(u, p) pushUnitPrompt((u), (p))
59 #endif
61 I18N_PLAY_FUNCTION(nl, pushUnitPrompt, uint8_t unitprompt, int16_t number)
63 #if defined(CPUARM)
64 if (number == 1)
65 PUSH_UNIT_PROMPT(unitprompt, 0);
66 else
67 PUSH_UNIT_PROMPT(unitprompt, 1);
68 #else
69 unitprompt = NL_PROMPT_UNITS_BASE + unitprompt*2;
70 if (number == 1)
71 PUSH_NUMBER_PROMPT(unitprompt);
72 else
73 PUSH_NUMBER_PROMPT(unitprompt+1);
74 #endif
77 I18N_PLAY_FUNCTION(nl, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
79 if (number < 0) {
80 PUSH_NUMBER_PROMPT(NL_PROMPT_MINUS);
81 number = -number;
84 #if !defined(CPUARM)
85 if (unit) {
86 unit--;
87 convertUnit(number, unit);
88 if (IS_IMPERIAL_ENABLE()) {
89 if (unit == UNIT_DIST) {
90 unit = UNIT_FEET;
92 if (unit == UNIT_SPEED) {
93 unit = UNIT_KTS;
96 unit++;
98 #endif
100 int8_t mode = MODE(att);
101 if (mode > 0) {
102 #if defined(CPUARM)
103 if (mode == 2) {
104 number /= 10;
106 #else
107 // we assume that we are PREC1
108 #endif
109 div_t qr = div((int)number, 10);
110 if (qr.rem) {
111 PLAY_NUMBER(qr.quot, 0, 0);
112 PUSH_NUMBER_PROMPT(NL_PROMPT_POINT_BASE + qr.rem);
113 number = -1;
115 else {
116 number = qr.quot;
120 int16_t tmp = number;
122 if (number >= 1000) {
123 PLAY_NUMBER(number / 1000, 0, 0);
124 PUSH_NUMBER_PROMPT(NL_PROMPT_THOUSAND);
125 number %= 1000;
126 if (number == 0)
127 number = -1;
129 if (number >= 100) {
130 PUSH_NUMBER_PROMPT(NL_PROMPT_HUNDRED + (number/100)-1);
131 number %= 100;
132 if (number == 0)
133 number = -1;
135 if (number >= 0) {
136 PUSH_NUMBER_PROMPT(NL_PROMPT_ZERO + number);
139 if (unit) {
140 NL_PUSH_UNIT_PROMPT(unit, tmp);
144 I18N_PLAY_FUNCTION(nl, playDuration, int seconds PLAY_DURATION_ATT)
146 if (seconds == 0) {
147 PLAY_NUMBER(seconds, 0, 0);
148 return;
151 if (seconds < 0) {
152 PUSH_NUMBER_PROMPT(NL_PROMPT_MINUS);
153 seconds = -seconds;
156 uint8_t tmp = seconds / 3600;
157 seconds %= 3600;
158 if (tmp > 0 || IS_PLAY_TIME()) {
159 PLAY_NUMBER(tmp, UNIT_HOURS, 0);
162 tmp = seconds / 60;
163 seconds %= 60;
164 if (tmp > 0) {
165 PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
166 if (seconds > 0)
167 PUSH_NUMBER_PROMPT(NL_PROMPT_AND);
170 if (seconds > 0) {
171 PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
175 LANGUAGE_PACK_DECLARE(nl, "Dutch");
177 #endif