From 57703965ae76a19db7ff306780fb86f38dbe7791 Mon Sep 17 00:00:00 2001 From: "bsongis@gmail.com" Date: Sat, 11 May 2013 07:45:21 +0000 Subject: [PATCH] [Taranis/sky9x] CZ language added --- src/Makefile | 2 +- src/gui/menu_general.cpp | 2 + src/translations/tts_cz.cpp | 154 ++++++++++++++++++------------------ 3 files changed, 81 insertions(+), 77 deletions(-) diff --git a/src/Makefile b/src/Makefile index 32aa824f3..7686bab6d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -652,7 +652,7 @@ TARGET = opentx # List C++ source files here. (C dependencies are automatically generated.) ifeq ($(PCB), $(filter $(PCB), SKY9X TARANIS)) - TTS_SRC = translations/tts_de.cpp translations/tts_en.cpp translations/tts_fr.cpp translations/tts_it.cpp + TTS_SRC = translations/tts_cz.cpp translations/tts_de.cpp translations/tts_en.cpp translations/tts_fr.cpp translations/tts_it.cpp else STD_TTS_SRC = translations/tts_$(shell sh -c "echo $(TTS) | tr '[:upper:]' '[:lower:]'").cpp TTS_SRC = $(shell sh -c "if test -f $(STD_TTS_SRC); then echo $(STD_TTS_SRC); else echo translations/tts_en.cpp; fi") diff --git a/src/gui/menu_general.cpp b/src/gui/menu_general.cpp index 4b47c1ffa..e2e1f5b26 100644 --- a/src/gui/menu_general.cpp +++ b/src/gui/menu_general.cpp @@ -41,12 +41,14 @@ const pm_uchar sticks[] PROGMEM = { }; #if defined(CPUARM) +extern LanguagePack czLanguagePack; extern LanguagePack enLanguagePack; extern LanguagePack frLanguagePack; extern LanguagePack deLanguagePack; extern LanguagePack itLanguagePack; LanguagePack * languagePacks[] = { // alphabetical order + &czLanguagePack, &enLanguagePack, &frLanguagePack, &deLanguagePack, diff --git a/src/translations/tts_cz.cpp b/src/translations/tts_cz.cpp index 234b2608c..f2d63304f 100644 --- a/src/translations/tts_cz.cpp +++ b/src/translations/tts_cz.cpp @@ -23,82 +23,82 @@ #include "../opentx.h" enum CzechPrompts { - PROMPT_NUMBERS_BASE = 0, - PROMPT_NULA = PROMPT_NUMBERS_BASE+0, //0-99 - PROMPT_STO = PROMPT_NUMBERS_BASE+100, //100,200 .. 900 - PROMPT_TISIC = PROMPT_NUMBERS_BASE+109, //1000 - PROMPT_TISICE = PROMPT_NUMBERS_BASE+110, - PROMPT_JEDEN = PROMPT_NUMBERS_BASE+111, - PROMPT_JEDNO = PROMPT_NUMBERS_BASE+112, - PROMPT_DVE = PROMPT_NUMBERS_BASE+113, - PROMPT_CELA = PROMPT_NUMBERS_BASE+114, - PROMPT_CELE = PROMPT_NUMBERS_BASE+115, - PROMPT_CELYCH = PROMPT_NUMBERS_BASE+116, - PROMPT_MINUS = PROMPT_NUMBERS_BASE+117, + CZ_PROMPT_NUMBERS_BASE = 0, + CZ_PROMPT_NULA = CZ_PROMPT_NUMBERS_BASE+0, //0-99 + CZ_PROMPT_STO = CZ_PROMPT_NUMBERS_BASE+100, //100,200 .. 900 + CZ_PROMPT_TISIC = CZ_PROMPT_NUMBERS_BASE+109, //1000 + CZ_PROMPT_TISICE = CZ_PROMPT_NUMBERS_BASE+110, + CZ_PROMPT_JEDEN = CZ_PROMPT_NUMBERS_BASE+111, + CZ_PROMPT_JEDNO = CZ_PROMPT_NUMBERS_BASE+112, + CZ_PROMPT_DVE = CZ_PROMPT_NUMBERS_BASE+113, + CZ_PROMPT_CELA = CZ_PROMPT_NUMBERS_BASE+114, + CZ_PROMPT_CELE = CZ_PROMPT_NUMBERS_BASE+115, + CZ_PROMPT_CELYCH = CZ_PROMPT_NUMBERS_BASE+116, + CZ_PROMPT_MINUS = CZ_PROMPT_NUMBERS_BASE+117, - PROMPT_UNITS_BASE = 118, - PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS, //(jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu - PROMPT_AMPS = PROMPT_UNITS_BASE+(UNIT_AMPS*4), - PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*4), - PROMPT_SPARE1 = PROMPT_UNITS_BASE+(UNIT_RAW*4), - PROMPT_KMH = PROMPT_UNITS_BASE+(UNIT_KMH*4), - PROMPT_METERS = PROMPT_UNITS_BASE+(UNIT_METERS*4), - PROMPT_DEGREES = PROMPT_UNITS_BASE+(UNIT_DEGREES*4), - PROMPT_PERCENT = PROMPT_UNITS_BASE+(UNIT_PERCENT*4), - PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*4), - PROMPT_MAH = PROMPT_UNITS_BASE+(UNIT_MAH*4), - PROMPT_WATTS = PROMPT_UNITS_BASE+(UNIT_WATTS*4), - PROMPT_DB = PROMPT_UNITS_BASE+(UNIT_DBM*4), - PROMPT_FEET = PROMPT_UNITS_BASE+(UNIT_FEET*4), - PROMPT_KTS = PROMPT_UNITS_BASE+(UNIT_KTS*4), - PROMPT_HOURS = PROMPT_UNITS_BASE+(UNIT_HOURS*4), - PROMPT_MINUTES = PROMPT_UNITS_BASE+(UNIT_MINUTES*4), - PROMPT_SECONDS = PROMPT_UNITS_BASE+(UNIT_SECONDS*4), - PROMPT_RPMS = PROMPT_UNITS_BASE+(UNIT_RPMS*4), - PROMPT_G = PROMPT_UNITS_BASE+(UNIT_G*4), + CZ_PROMPT_UNITS_BASE = 118, + CZ_PROMPT_VOLTS = CZ_PROMPT_UNITS_BASE+UNIT_VOLTS, //(jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu + CZ_PROMPT_AMPS = CZ_PROMPT_UNITS_BASE+(UNIT_AMPS*4), + CZ_PROMPT_METERS_PER_SECOND = CZ_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*4), + CZ_PROMPT_SPARE1 = CZ_PROMPT_UNITS_BASE+(UNIT_RAW*4), + CZ_PROMPT_KMH = CZ_PROMPT_UNITS_BASE+(UNIT_KMH*4), + CZ_PROMPT_METERS = CZ_PROMPT_UNITS_BASE+(UNIT_METERS*4), + CZ_PROMPT_DEGREES = CZ_PROMPT_UNITS_BASE+(UNIT_DEGREES*4), + CZ_PROMPT_PERCENT = CZ_PROMPT_UNITS_BASE+(UNIT_PERCENT*4), + CZ_PROMPT_MILLIAMPS = CZ_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*4), + CZ_PROMPT_MAH = CZ_PROMPT_UNITS_BASE+(UNIT_MAH*4), + CZ_PROMPT_WATTS = CZ_PROMPT_UNITS_BASE+(UNIT_WATTS*4), + CZ_PROMPT_DB = CZ_PROMPT_UNITS_BASE+(UNIT_DBM*4), + CZ_PROMPT_FEET = CZ_PROMPT_UNITS_BASE+(UNIT_FEET*4), + CZ_PROMPT_KTS = CZ_PROMPT_UNITS_BASE+(UNIT_KTS*4), + CZ_PROMPT_HOURS = CZ_PROMPT_UNITS_BASE+(UNIT_HOURS*4), + CZ_PROMPT_MINUTES = CZ_PROMPT_UNITS_BASE+(UNIT_MINUTES*4), + CZ_PROMPT_SECONDS = CZ_PROMPT_UNITS_BASE+(UNIT_SECONDS*4), + CZ_PROMPT_RPMS = CZ_PROMPT_UNITS_BASE+(UNIT_RPMS*4), + CZ_PROMPT_G = CZ_PROMPT_UNITS_BASE+(UNIT_G*4), - PROMPT_LABELS_BASE = 194, - PROMPT_TIMER1 = PROMPT_LABELS_BASE+TELEM_TM1, - PROMPT_TIMER2 = PROMPT_LABELS_BASE+TELEM_TM2, - PROMPT_RSSI_TX = PROMPT_LABELS_BASE+TELEM_RSSI_TX, - PROMPT_RSSI_RX = PROMPT_LABELS_BASE+TELEM_RSSI_RX, - PROMPT_A1 = PROMPT_LABELS_BASE+TELEM_A1, - PROMPT_A2 = PROMPT_LABELS_BASE+TELEM_A2, - PROMPT_ALTITUDE = PROMPT_LABELS_BASE+TELEM_ALT, - PROMPT_RPM = PROMPT_LABELS_BASE+TELEM_RPM, - PROMPT_ESSENCE = PROMPT_LABELS_BASE+TELEM_FUEL, - PROMPT_T1 = PROMPT_LABELS_BASE+TELEM_T1, - PROMPT_T2 = PROMPT_LABELS_BASE+TELEM_T2, - PROMPT_VITESSE = PROMPT_LABELS_BASE+TELEM_SPEED, - PROMPT_DISTANCE = PROMPT_LABELS_BASE+TELEM_DIST, - PROMPT_GPSALTITUDE = PROMPT_LABELS_BASE+TELEM_GPSALT, - PROMPT_ELEMENTS_LIPO = PROMPT_LABELS_BASE+TELEM_CELL, - PROMPT_TOTAL_LIPO = PROMPT_LABELS_BASE+TELEM_CELLS_SUM, - PROMPT_VFAS = PROMPT_LABELS_BASE+TELEM_VFAS, - PROMPT_COURANT = PROMPT_LABELS_BASE+TELEM_CURRENT, - PROMPT_CONSOMMATION = PROMPT_LABELS_BASE+TELEM_CONSUMPTION, - PROMPT_PUISSANCE = PROMPT_LABELS_BASE+TELEM_POWER, - PROMPT_ACCELx = PROMPT_LABELS_BASE+TELEM_ACCx, - PROMPT_ACCELy = PROMPT_LABELS_BASE+TELEM_ACCy, - PROMPT_ACCELz = PROMPT_LABELS_BASE+TELEM_ACCz, - PROMPT_HDG = PROMPT_LABELS_BASE+TELEM_HDG, - PROMPT_VARIO = PROMPT_LABELS_BASE+TELEM_VSPD, + CZ_PROMPT_LABELS_BASE = 194, + CZ_PROMPT_TIMER1 = CZ_PROMPT_LABELS_BASE+TELEM_TM1, + CZ_PROMPT_TIMER2 = CZ_PROMPT_LABELS_BASE+TELEM_TM2, + CZ_PROMPT_RSSI_TX = CZ_PROMPT_LABELS_BASE+TELEM_RSSI_TX, + CZ_PROMPT_RSSI_RX = CZ_PROMPT_LABELS_BASE+TELEM_RSSI_RX, + CZ_PROMPT_A1 = CZ_PROMPT_LABELS_BASE+TELEM_A1, + CZ_PROMPT_A2 = CZ_PROMPT_LABELS_BASE+TELEM_A2, + CZ_PROMPT_ALTITUDE = CZ_PROMPT_LABELS_BASE+TELEM_ALT, + CZ_PROMPT_RPM = CZ_PROMPT_LABELS_BASE+TELEM_RPM, + CZ_PROMPT_ESSENCE = CZ_PROMPT_LABELS_BASE+TELEM_FUEL, + CZ_PROMPT_T1 = CZ_PROMPT_LABELS_BASE+TELEM_T1, + CZ_PROMPT_T2 = CZ_PROMPT_LABELS_BASE+TELEM_T2, + CZ_PROMPT_VITESSE = CZ_PROMPT_LABELS_BASE+TELEM_SPEED, + CZ_PROMPT_DISTANCE = CZ_PROMPT_LABELS_BASE+TELEM_DIST, + CZ_PROMPT_GPSALTITUDE = CZ_PROMPT_LABELS_BASE+TELEM_GPSALT, + CZ_PROMPT_ELEMENTS_LIPO = CZ_PROMPT_LABELS_BASE+TELEM_CELL, + CZ_PROMPT_TOTAL_LIPO = CZ_PROMPT_LABELS_BASE+TELEM_CELLS_SUM, + CZ_PROMPT_VFAS = CZ_PROMPT_LABELS_BASE+TELEM_VFAS, + CZ_PROMPT_COURANT = CZ_PROMPT_LABELS_BASE+TELEM_CURRENT, + CZ_PROMPT_CONSOMMATION = CZ_PROMPT_LABELS_BASE+TELEM_CONSUMPTION, + CZ_PROMPT_PUISSANCE = CZ_PROMPT_LABELS_BASE+TELEM_POWER, + CZ_PROMPT_ACCELx = CZ_PROMPT_LABELS_BASE+TELEM_ACCx, + CZ_PROMPT_ACCELy = CZ_PROMPT_LABELS_BASE+TELEM_ACCy, + CZ_PROMPT_ACCELz = CZ_PROMPT_LABELS_BASE+TELEM_ACCz, + CZ_PROMPT_HDG = CZ_PROMPT_LABELS_BASE+TELEM_HDG, + CZ_PROMPT_VARIO = CZ_PROMPT_LABELS_BASE+TELEM_VSPD, }; #if defined(VOICE) #if defined(CPUARM) -#define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u), id) + #define PUSH_UNIT_PROMPT(p, u) cz_pushUnitPrompt((p), (u), id) #else -#define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u)) + #define PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u)) #endif #define MUZSKY 0x80 #define ZENSKY 0x81 #define STREDNI 0x82 -PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt) +I18N_PLAY_FUNCTION(cz, pushUnitPrompt, int16_t number, uint8_t unitprompt) { if (number == 1) PUSH_NUMBER_PROMPT(unitprompt); @@ -108,11 +108,11 @@ PLAY_FUNCTION(pushUnitPrompt, int16_t number, uint8_t unitprompt) PUSH_NUMBER_PROMPT(unitprompt+2); } -PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) +I18N_PLAY_FUNCTION(cz, playNumber, getvalue_t number, uint8_t unit, uint8_t att) { if (number < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MINUS); + PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS); number = -number; } @@ -134,11 +134,11 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (qr.rem) { PLAY_NUMBER(qr.quot, 0, ZENSKY); if (qr.quot == 0) - PUSH_NUMBER_PROMPT(PROMPT_CELA); + PUSH_NUMBER_PROMPT(CZ_PROMPT_CELA); else - PUSH_UNIT_PROMPT(qr.quot, PROMPT_CELA); + PUSH_UNIT_PROMPT(qr.quot, CZ_PROMPT_CELA); PLAY_NUMBER(qr.rem, 0, ZENSKY); - PUSH_NUMBER_PROMPT(PROMPT_UNITS_BASE+((unit-1)*4)+3); + PUSH_NUMBER_PROMPT(CZ_PROMPT_UNITS_BASE+((unit-1)*4)+3); return; } else @@ -169,17 +169,17 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) } if ((number == 1) && (att == MUZSKY)) { - PUSH_NUMBER_PROMPT(PROMPT_JEDEN); + PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDEN); number = -1; } if ((number == 1) && (att == STREDNI)) { - PUSH_NUMBER_PROMPT(PROMPT_JEDNO); + PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDNO); number = -1; } if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) { - PUSH_NUMBER_PROMPT(PROMPT_DVE); + PUSH_NUMBER_PROMPT(CZ_PROMPT_DVE); number = -1; } @@ -187,33 +187,33 @@ PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) if (number >= 2000) PLAY_NUMBER(number / 1000, 0, 0); if (number >= 2000 && number < 5000) - PUSH_NUMBER_PROMPT(PROMPT_TISICE); + PUSH_NUMBER_PROMPT(CZ_PROMPT_TISICE); else - PUSH_NUMBER_PROMPT(PROMPT_TISIC); + PUSH_NUMBER_PROMPT(CZ_PROMPT_TISIC); number %= 1000; if (number == 0) number = -1; } if (number >= 100) { - PUSH_NUMBER_PROMPT(PROMPT_STO + (number/100)-1); + PUSH_NUMBER_PROMPT(CZ_PROMPT_STO + (number/100)-1); number %= 100; if (number == 0) number = -1; } if (number >= 0) { - PUSH_NUMBER_PROMPT(PROMPT_NULA+number); + PUSH_NUMBER_PROMPT(CZ_PROMPT_NULA+number); } if (unit) { - PUSH_UNIT_PROMPT(tmp, (PROMPT_UNITS_BASE+((unit-1)*4))); + PUSH_UNIT_PROMPT(tmp, (CZ_PROMPT_UNITS_BASE+((unit-1)*4))); } } -PLAY_FUNCTION(playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(cz, playDuration, int16_t seconds) { if (seconds < 0) { - PUSH_NUMBER_PROMPT(PROMPT_MINUS); + PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS); seconds = -seconds; } @@ -234,4 +234,6 @@ PLAY_FUNCTION(playDuration, int16_t seconds) } } +LANGUAGE_PACK_DECLARE(cz, "czech"); + #endif