Changes to add danish translations - companion and radio 🇩🇰 (#2101)
Added Danish translations to Companion and radio firmware.
This commit is contained in:
@@ -107,7 +107,7 @@ configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_B
|
|||||||
### Generate .qm files and assemble resource (qrc) file.
|
### Generate .qm files and assemble resource (qrc) file.
|
||||||
|
|
||||||
# available Companion translations (src/translations/*.ts)
|
# available Companion translations (src/translations/*.ts)
|
||||||
set(LANGUAGES cs de en es fi fr it pl ru sv zh_CN ja)
|
set(LANGUAGES cs da de en es fi fr it pl ru sv zh_CN ja)
|
||||||
foreach(language ${LANGUAGES})
|
foreach(language ${LANGUAGES})
|
||||||
list(APPEND companion_TS translations/companion_${language}.ts)
|
list(APPEND companion_TS translations/companion_${language}.ts)
|
||||||
endforeach(language)
|
endforeach(language)
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class OpenTxFirmware: public Firmware
|
|||||||
{
|
{
|
||||||
addLanguage("en");
|
addLanguage("en");
|
||||||
addLanguage("cz");
|
addLanguage("cz");
|
||||||
|
addLanguage("da");
|
||||||
addLanguage("de");
|
addLanguage("de");
|
||||||
addLanguage("es");
|
addLanguage("es");
|
||||||
addLanguage("fr");
|
addLanguage("fr");
|
||||||
|
|||||||
@@ -348,8 +348,8 @@ void GeneralSetupPanel::populateBacklightCB()
|
|||||||
void GeneralSetupPanel::populateVoiceLangCB()
|
void GeneralSetupPanel::populateVoiceLangCB()
|
||||||
{
|
{
|
||||||
QComboBox * b = ui->voiceLang_CB;
|
QComboBox * b = ui->voiceLang_CB;
|
||||||
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 strings[] = { tr("English"), tr("Danish"), 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};
|
QString langcode[] = { "en", "da", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "ru", "se", "hu", NULL};
|
||||||
|
|
||||||
b->clear();
|
b->clear();
|
||||||
for (int i=0; strings[i]!=NULL; i++) {
|
for (int i=0; strings[i]!=NULL; i++) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ QStringList const Translations::getAvailableTranslations()
|
|||||||
|
|
||||||
if (!locales.size()) {
|
if (!locales.size()) {
|
||||||
locales << "cs_CZ"
|
locales << "cs_CZ"
|
||||||
|
<< "da_DA"
|
||||||
<< "de_DE"
|
<< "de_DE"
|
||||||
<< "en"
|
<< "en"
|
||||||
<< "es_ES"
|
<< "es_ES"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,8 @@ include(CMakeForceCompiler)
|
|||||||
include(Bitmaps)
|
include(Bitmaps)
|
||||||
|
|
||||||
set(PCB_TYPES X9LITE X9LITES X7 XLITE XLITES X9D X9D+ X9E X10 X12S NV14)
|
set(PCB_TYPES X9LITE X9LITES X7 XLITE XLITES X9D X9D+ X9E X10 X12S NV14)
|
||||||
set(RADIO_LANGUAGES CZ DE EN ES FI FR IT PT SK SE PL HU NL CN TW)
|
set(RADIO_LANGUAGES CZ DA DE EN ES FI FR IT PT SK SE PL HU NL CN TW)
|
||||||
set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL RU CN)
|
set(TTS_LANGUAGES CZ DA DE EN ES FR IT PT SK SE PL HU NL RU CN)
|
||||||
|
|
||||||
set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}")
|
set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}")
|
||||||
set_property(CACHE PCB PROPERTY STRINGS ${PCB_TYPES})
|
set_property(CACHE PCB PROPERTY STRINGS ${PCB_TYPES})
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ const unsigned char font_5x7[] = {
|
|||||||
#include "font_05x07_extra.lbm"
|
#include "font_05x07_extra.lbm"
|
||||||
#if defined(TRANSLATIONS_DE)
|
#if defined(TRANSLATIONS_DE)
|
||||||
#include "font_de_05x07.lbm"
|
#include "font_de_05x07.lbm"
|
||||||
|
#elif defined(TRANSLATIONS_DA)
|
||||||
|
#include "font_se_05x07.lbm"
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
#elif defined(TRANSLATIONS_CZ)
|
||||||
#include "font_cz_05x07.lbm"
|
#include "font_cz_05x07.lbm"
|
||||||
#elif defined(TRANSLATIONS_ES)
|
#elif defined(TRANSLATIONS_ES)
|
||||||
@@ -54,6 +56,8 @@ const unsigned char font_10x14[] = {
|
|||||||
#include "font_10x14_compressed.lbm"
|
#include "font_10x14_compressed.lbm"
|
||||||
#if defined(TRANSLATIONS_DE)
|
#if defined(TRANSLATIONS_DE)
|
||||||
#include "font_de_10x14.lbm"
|
#include "font_de_10x14.lbm"
|
||||||
|
#elif defined(TRANSLATIONS_DA)
|
||||||
|
#include "font_se_10x14.lbm"
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
#elif defined(TRANSLATIONS_CZ)
|
||||||
#include "font_cz_10x14.lbm"
|
#include "font_cz_10x14.lbm"
|
||||||
#elif defined(TRANSLATIONS_ES)
|
#elif defined(TRANSLATIONS_ES)
|
||||||
@@ -81,6 +85,8 @@ const unsigned char font_4x6[] = {
|
|||||||
#include "font_04x06.lbm"
|
#include "font_04x06.lbm"
|
||||||
#if defined(TRANSLATIONS_DE)
|
#if defined(TRANSLATIONS_DE)
|
||||||
#include "font_de_04x06.lbm"
|
#include "font_de_04x06.lbm"
|
||||||
|
#elif defined(TRANSLATIONS_DA)
|
||||||
|
#include "font_se_04x06.lbm"
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
#elif defined(TRANSLATIONS_CZ)
|
||||||
#include "font_cz_04x06.lbm"
|
#include "font_cz_04x06.lbm"
|
||||||
#elif defined(TRANSLATIONS_ES)
|
#elif defined(TRANSLATIONS_ES)
|
||||||
@@ -104,6 +110,8 @@ const unsigned char font_8x10[] = {
|
|||||||
#include "font_08x10.lbm"
|
#include "font_08x10.lbm"
|
||||||
#if defined(TRANSLATIONS_DE)
|
#if defined(TRANSLATIONS_DE)
|
||||||
#include "font_de_08x10.lbm"
|
#include "font_de_08x10.lbm"
|
||||||
|
#elif defined(TRANSLATIONS_DA)
|
||||||
|
#include "font_cz_08x10.lbm"
|
||||||
#elif defined(TRANSLATIONS_CZ)
|
#elif defined(TRANSLATIONS_CZ)
|
||||||
#include "font_cz_08x10.lbm"
|
#include "font_cz_08x10.lbm"
|
||||||
#elif defined(TRANSLATIONS_ES)
|
#elif defined(TRANSLATIONS_ES)
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
#elif defined(TRANSLATIONS_IT)
|
#elif defined(TRANSLATIONS_IT)
|
||||||
#include "translations/it.h"
|
#include "translations/it.h"
|
||||||
#define LEN_SPECIAL_CHARS 1
|
#define LEN_SPECIAL_CHARS 1
|
||||||
|
#elif defined(TRANSLATIONS_DA)
|
||||||
|
#include "translations/da.h"
|
||||||
|
#define LEN_SPECIAL_CHARS 6
|
||||||
#elif defined(TRANSLATIONS_SE)
|
#elif defined(TRANSLATIONS_SE)
|
||||||
#include "translations/se.h"
|
#include "translations/se.h"
|
||||||
#define LEN_SPECIAL_CHARS 6
|
#define LEN_SPECIAL_CHARS 6
|
||||||
@@ -768,6 +771,7 @@ extern const LanguagePack * currentLanguagePack;
|
|||||||
extern uint8_t currentLanguagePackIdx;
|
extern uint8_t currentLanguagePackIdx;
|
||||||
|
|
||||||
extern const LanguagePack czLanguagePack;
|
extern const LanguagePack czLanguagePack;
|
||||||
|
extern const LanguagePack daLanguagePack;
|
||||||
extern const LanguagePack deLanguagePack;
|
extern const LanguagePack deLanguagePack;
|
||||||
extern const LanguagePack enLanguagePack;
|
extern const LanguagePack enLanguagePack;
|
||||||
extern const LanguagePack esLanguagePack;
|
extern const LanguagePack esLanguagePack;
|
||||||
@@ -787,6 +791,7 @@ extern const LanguagePack * const languagePacks[];
|
|||||||
const LanguagePack * const languagePacks[] = {
|
const LanguagePack * const languagePacks[] = {
|
||||||
// alphabetical order
|
// alphabetical order
|
||||||
&czLanguagePack,
|
&czLanguagePack,
|
||||||
|
&daLanguagePack,
|
||||||
&deLanguagePack,
|
&deLanguagePack,
|
||||||
&enLanguagePack,
|
&enLanguagePack,
|
||||||
&esLanguagePack,
|
&esLanguagePack,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) EdgeTX
|
||||||
|
*
|
||||||
|
* Based on code named
|
||||||
|
* opentx - https://github.com/opentx/opentx
|
||||||
|
* th9x - http://code.google.com/p/th9x
|
||||||
|
* er9x - http://code.google.com/p/er9x
|
||||||
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||||
|
*
|
||||||
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "opentx.h"
|
||||||
|
|
||||||
|
enum DanishPrompts {
|
||||||
|
DA_PROMPT_NUMBERS_BASE = 0,
|
||||||
|
DA_PROMPT_ZERO = DA_PROMPT_NUMBERS_BASE+0, //02-99
|
||||||
|
DA_PROMPT_HUNDRED = DA_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||||
|
DA_PROMPT_THOUSAND = DA_PROMPT_NUMBERS_BASE+109, //1000
|
||||||
|
DA_PROMPT_AND = DA_PROMPT_NUMBERS_BASE+110,
|
||||||
|
DA_PROMPT_MINUS = DA_PROMPT_NUMBERS_BASE+111,
|
||||||
|
DA_PROMPT_POINT = DA_PROMPT_NUMBERS_BASE+112,
|
||||||
|
DA_PROMPT_UNITS_BASE = 113,
|
||||||
|
DA_PROMPT_POINT_BASE = 165, //.0 - .9
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define DA_PUSH_UNIT_PROMPT(u, p) da_pushUnitPrompt((u), (p), id)
|
||||||
|
|
||||||
|
I18N_PLAY_FUNCTION(da, pushUnitPrompt, uint8_t unitprompt, int16_t number)
|
||||||
|
{
|
||||||
|
if (number == 1)
|
||||||
|
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||||
|
else
|
||||||
|
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
I18N_PLAY_FUNCTION(da, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||||
|
{
|
||||||
|
if (number < 0) {
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_MINUS);
|
||||||
|
number = -number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int8_t mode = MODE(att);
|
||||||
|
if (mode > 0) {
|
||||||
|
if (mode == 2) {
|
||||||
|
number /= 10;
|
||||||
|
}
|
||||||
|
div_t qr = div((int)number, 10);
|
||||||
|
if (qr.rem) {
|
||||||
|
PLAY_NUMBER(qr.quot, 0, 0);
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_POINT_BASE + qr.rem);
|
||||||
|
number = -1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
number = qr.quot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t tmpNumber = number;
|
||||||
|
|
||||||
|
if (number >= 1000) {
|
||||||
|
PLAY_NUMBER(number / 1000, 0, 0);
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_THOUSAND);
|
||||||
|
number %= 1000;
|
||||||
|
if (number == 0)
|
||||||
|
number = -1;
|
||||||
|
}
|
||||||
|
if (number >= 100) {
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_HUNDRED + (number/100)-1);
|
||||||
|
number %= 100;
|
||||||
|
if (number == 0)
|
||||||
|
number = -1;
|
||||||
|
}
|
||||||
|
if (number >= 0) {
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_ZERO + number);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unit) {
|
||||||
|
DA_PUSH_UNIT_PROMPT(unit, tmpNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
I18N_PLAY_FUNCTION(da, playDuration, int seconds PLAY_DURATION_ATT)
|
||||||
|
{
|
||||||
|
if (seconds < 0) {
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_MINUS);
|
||||||
|
seconds = -seconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t tmp = seconds / 3600;
|
||||||
|
seconds %= 3600;
|
||||||
|
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||||
|
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp = seconds / 60;
|
||||||
|
seconds %= 60;
|
||||||
|
if (tmp > 0) {
|
||||||
|
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||||
|
if (seconds > 0)
|
||||||
|
PUSH_NUMBER_PROMPT(DA_PROMPT_AND);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (seconds > 0) {
|
||||||
|
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LANGUAGE_PACK_DECLARE(da, "Danish");
|
||||||
|
|
||||||
Reference in New Issue
Block a user