From 9df21ceb6e0d84185f6ceb7f9b3cb29535631bb7 Mon Sep 17 00:00:00 2001 From: Kilrah Date: Sat, 18 Aug 2018 13:27:52 +0200 Subject: [PATCH] NL TTS as copy of EN as per new info on #6108. --- companion/src/generaledit/generalsetup.cpp | 4 ++-- radio/src/CMakeLists.txt | 2 +- radio/src/translations.h | 10 ++++---- radio/src/translations/tts_nl.cpp | 27 +++++++++++++++++----- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/companion/src/generaledit/generalsetup.cpp b/companion/src/generaledit/generalsetup.cpp index 2c3da8e42..d2265a009 100644 --- a/companion/src/generaledit/generalsetup.cpp +++ b/companion/src/generaledit/generalsetup.cpp @@ -325,8 +325,8 @@ void GeneralSetupPanel::populateBacklightCB() void GeneralSetupPanel::populateVoiceLangCB() { QComboBox * b = ui->voiceLang_CB; - QString strings[] = { tr("English"), tr("French"), tr("Italian"), tr("German"), tr("Czech"), tr("Slovak"), tr("Spanish"), tr("Polish"), tr("Portuguese"), tr("Russian"), tr("Swedish"), tr("Hungarian"), NULL}; - QString langcode[] = { "en", "fr", "it", "de", "cz", "sk", "es", "pl", "pt", "ru", "se", "hu", NULL}; + QString strings[] = { tr("English"), tr("Dutch"), tr("French"), tr("Italian"), tr("German"), tr("Czech"), tr("Slovak"), tr("Spanish"), tr("Polish"), tr("Portuguese"), tr("Russian"), tr("Swedish"), tr("Hungarian"), NULL}; + QString langcode[] = { "en", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "ru", "se", "hu", NULL}; b->clear(); for (int i=0; strings[i]!=NULL; i++) { diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 85b0f88a9..35b9922fd 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -3,7 +3,7 @@ include(Bitmaps) set(PCB_TYPES X7 XLITE X9D X9D+ X9E X10 X12S SKY9X 9XRPRO AR9X) set(GUI_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL) -set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU RU) +set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL RU) set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}") set_property(CACHE PCB PROPERTY STRINGS ${PCB_TYPES}) diff --git a/radio/src/translations.h b/radio/src/translations.h index b2fa391ec..652661d68 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -766,17 +766,18 @@ extern const char STR_BLCOLOR[]; extern uint8_t currentLanguagePackIdx; extern const LanguagePack czLanguagePack; + extern const LanguagePack deLanguagePack; extern const LanguagePack enLanguagePack; extern const LanguagePack esLanguagePack; extern const LanguagePack frLanguagePack; - extern const LanguagePack deLanguagePack; + extern const LanguagePack huLanguagePack; extern const LanguagePack itLanguagePack; + extern const LanguagePack nlLanguagePack; extern const LanguagePack plLanguagePack; extern const LanguagePack ptLanguagePack; - extern const LanguagePack skLanguagePack; - extern const LanguagePack seLanguagePack; - extern const LanguagePack huLanguagePack; extern const LanguagePack ruLanguagePack; + extern const LanguagePack seLanguagePack; + extern const LanguagePack skLanguagePack; extern const LanguagePack * const languagePacks[]; #if defined(LANGUAGE_PACKS_DEFINITION) const LanguagePack * const languagePacks[] = { @@ -788,6 +789,7 @@ extern const char STR_BLCOLOR[]; &frLanguagePack, &huLanguagePack, &itLanguagePack, + &nlLanguagePack, &plLanguagePack, &ptLanguagePack, &ruLanguagePack, diff --git a/radio/src/translations/tts_nl.cpp b/radio/src/translations/tts_nl.cpp index 235e18285..43c815163 100644 --- a/radio/src/translations/tts_nl.cpp +++ b/radio/src/translations/tts_nl.cpp @@ -1,8 +1,21 @@ /* * Authors (alphabetical order) * - Andre Bernet + * - Andreas Weitl * - Bertrand Songis - * - Jean-Pierre van Melis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer * * opentx is based on code named * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, @@ -21,6 +34,8 @@ * */ +// NOTE: This file is identical to the EN version + #include "opentx.h" enum DutchPrompts { @@ -32,13 +47,13 @@ enum DutchPrompts { NL_PROMPT_MINUS = NL_PROMPT_NUMBERS_BASE+111, NL_PROMPT_POINT = NL_PROMPT_NUMBERS_BASE+112, NL_PROMPT_UNITS_BASE = 113, - NL_PROMPT_POINT_BASE = 165, //.0 - .9 + NL_PROMPT_POINT_BASE = 167, //.0 - .9 }; #define NL_PUSH_UNIT_PROMPT(u, p) nl_pushUnitPrompt((u), (p), id) -I18N_PLAY_FUNCTION(nl, pushUnitPrompt, uint8_t unitprompt, int16_t number) +I18N_PLAY_FUNCTION(nl, pushUnitPrompt, uint8_t unitprompt, int16_t number) { if (number == 1) PUSH_UNIT_PROMPT(unitprompt, 0); @@ -59,7 +74,7 @@ I18N_PLAY_FUNCTION(nl, playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (mode == 2) { number /= 10; } - div_t qr = div(number, 10); + div_t qr = div((int)number, 10); if (qr.rem) { PLAY_NUMBER(qr.quot, 0, 0); PUSH_NUMBER_PROMPT(NL_PROMPT_POINT_BASE + qr.rem); @@ -75,7 +90,6 @@ I18N_PLAY_FUNCTION(nl, playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (number >= 1000) { PLAY_NUMBER(number / 1000, 0, 0); PUSH_NUMBER_PROMPT(NL_PROMPT_THOUSAND); - number %= 1000; if (number == 0) number = -1; @@ -120,10 +134,11 @@ I18N_PLAY_FUNCTION(nl, playDuration, int seconds PLAY_DURATION_ATT) if (seconds > 0) PUSH_NUMBER_PROMPT(NL_PROMPT_AND); } + if (seconds > 0) { PLAY_NUMBER(seconds, UNIT_SECONDS, 0); } } -LANGUAGE_PACK_DECLARE(nl, "Nederlands"); +LANGUAGE_PACK_DECLARE(nl, "Dutch");