feat: Add Russian translation to firmware 🇷🇺 (#4067)
@@ -112,6 +112,7 @@ class OpenTxFirmware: public Firmware
|
||||
addLanguage("nl");
|
||||
addLanguage("pl");
|
||||
addLanguage("pt");
|
||||
addLanguage("ru");
|
||||
addLanguage("se");
|
||||
addLanguage("sk");
|
||||
addLanguage("tw");
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<message>
|
||||
<location filename="../storage/appdata.h" line="654"/>
|
||||
<source>Prompt</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Сейчас</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../storage/appdata.h" line="655"/>
|
||||
@@ -144,7 +144,7 @@
|
||||
<message>
|
||||
<location filename="../storage/appdata.h" line="657"/>
|
||||
<source>Critical</source>
|
||||
<translation type="unfinished">Критический</translation>
|
||||
<translation>Критический</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../storage/appdata.h" line="657"/>
|
||||
@@ -218,7 +218,7 @@ Mode 4:
|
||||
Right stick: Elevator, Rudder
|
||||
|
||||
</source>
|
||||
<translation>Выбор моды передатчика:
|
||||
<translation>Выбор модели передатчика:
|
||||
|
||||
Mode 1:
|
||||
Левый стик: Руль высоты (Elevator), Руль направления (Rudder)
|
||||
|
||||
@@ -2,8 +2,8 @@ include(CMakeForceCompiler)
|
||||
include(Bitmaps)
|
||||
|
||||
set(PCB_TYPES X9LITE X9LITES X7 XLITE XLITES X9D X9D+ X9E X10 X12S NV14)
|
||||
set(RADIO_LANGUAGES CN CZ DA DE EN ES FI FR HE IT JP PT SK SE PL HU NL TW)
|
||||
set(TTS_LANGUAGES CN CZ DA DE EN ES FR HE IT JP PT SK SE PL HU NL RU)
|
||||
set(RADIO_LANGUAGES CN CZ DA DE EN ES FI FR HE IT JP PT RU SK SE PL HU NL TW)
|
||||
set(TTS_LANGUAGES CN CZ DA DE EN ES FR HE IT JP PT RU SK SE PL HU NL)
|
||||
|
||||
set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}")
|
||||
set_property(CACHE PCB PROPERTY STRINGS ${PCB_TYPES})
|
||||
|
||||
@@ -28,6 +28,8 @@ JP_SYMBOLS="${JP_Hiragana},${JP_Katakana},${JP_Kanji}"
|
||||
|
||||
HE_SYMBOLS="0x05D0-0x05F4"
|
||||
|
||||
RU_SYMBOLS="0x0410-0x044f"
|
||||
|
||||
# https://yeun.github.io/open-arrow/
|
||||
ARROWS_FONT="EdgeTX/OpenArrow-Regular.woff"
|
||||
# 0x80: right, 0x81: left, 0x82: up, 0x83: down
|
||||
@@ -113,3 +115,4 @@ make_font_set "noto_tw" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bol
|
||||
make_font_set "noto_cn" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" ",${CN_SYMBOLS}"
|
||||
make_font_set "noto_jp" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" ",${JP_SYMBOLS}"
|
||||
make_font_set "arimo_he" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" ",${HE_SYMBOLS}"
|
||||
make_font_set "Arimo_ru" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" ",${RU_SYMBOLS}"
|
||||
|
||||
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 571 B |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 571 B |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -43,6 +43,8 @@
|
||||
FONT_TABLE(noto_jp);
|
||||
#elif defined(TRANSLATIONS_HE)
|
||||
FONT_TABLE(arimo_he);
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
FONT_TABLE(arimo_ru);
|
||||
#else
|
||||
FONT_TABLE(roboto);
|
||||
#endif
|
||||
|
||||
@@ -42,6 +42,8 @@ const unsigned char font_5x7[] = {
|
||||
#include "font_pl_05x07.lbm"
|
||||
#elif defined(TRANSLATIONS_PT)
|
||||
#include "font_pt_05x07.lbm"
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
#include "font_ru_05x07.lbm"
|
||||
#elif defined(TRANSLATIONS_SE)
|
||||
#include "font_se_05x07.lbm"
|
||||
#endif
|
||||
@@ -72,6 +74,8 @@ const unsigned char font_10x14[] = {
|
||||
#include "font_pl_10x14.lbm"
|
||||
#elif defined(TRANSLATIONS_PT)
|
||||
#include "font_pt_10x14.lbm"
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
#include "font_ru_10x14.lbm"
|
||||
#elif defined(TRANSLATIONS_SE)
|
||||
#include "font_se_10x14.lbm"
|
||||
#endif
|
||||
@@ -101,6 +105,8 @@ const unsigned char font_4x6[] = {
|
||||
#include "font_pl_04x06.lbm"
|
||||
#elif defined(TRANSLATIONS_PT)
|
||||
#include "font_pt_04x06.lbm"
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
#include "font_ru_04x06.lbm"
|
||||
#elif defined(TRANSLATIONS_SE)
|
||||
#include "font_se_04x06.lbm"
|
||||
#endif
|
||||
@@ -126,6 +132,8 @@ const unsigned char font_8x10[] = {
|
||||
#include "font_pl_08x10.lbm"
|
||||
#elif defined(TRANSLATIONS_PT)
|
||||
#include "font_pt_08x10.lbm"
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
#include "font_ru_08x10.lbm"
|
||||
#elif defined(TRANSLATIONS_SE)
|
||||
#include "font_se_08x10.lbm"
|
||||
#endif
|
||||
|
||||
@@ -95,6 +95,19 @@ static wchar_t _utf8_lut[] = {
|
||||
L'ż', L'ź', L'Ą', L'Ć', L'Ę', L'Ł', L'Ń',
|
||||
L'Ó', L'Ś', L'Ż', L'Ź',
|
||||
};
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
static wchar_t _utf8_lut[] = {
|
||||
L'А', L'Б', L'В', L'Г', L'Д', L'Е', L'Ж',
|
||||
L'З', L'И', L'Й', L'К', L'Л', L'М', L'Н',
|
||||
L'О', L'П', L'Р', L'С', L'Т', L'У', L'Ф',
|
||||
L'Х', L'Ц', L'Ч', L'Ш', L'Щ', L'Ъ', L'Ы',
|
||||
L'Ь', L'Э', L'Ю', L'Я', L'а', L'б', L'в',
|
||||
L'г', L'д', L'е', L'ж', L'з', L'и', L'й',
|
||||
L'к', L'л', L'м', L'н', L'о', L'п', L'р',
|
||||
L'с', L'т', L'у', L'ф', L'х', L'ц', L'ч',
|
||||
L'ш', L'щ', L'ъ', L'ы', L'ь', L'э', L'ю',
|
||||
L'я',
|
||||
};
|
||||
#elif defined(TRANSLATIONS_SE)
|
||||
static wchar_t _utf8_lut[] = {
|
||||
L'å', L'ä', L'ö', L'Å', L'Ä', L'Ö',
|
||||
|
||||
@@ -424,6 +424,22 @@
|
||||
/*Always set a default font*/
|
||||
#define LV_FONT_DEFAULT &lv_font_noto_tw_16
|
||||
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
#define LV_FONT_CUSTOM_DECLARE \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_9) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_13) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_16) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_17) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_24) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_64) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_bold_16) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_bold_17) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_bold_32) \
|
||||
LV_FONT_DECLARE(lv_font_arimo_ru_bold_64)
|
||||
|
||||
/*Always set a default font*/
|
||||
#define LV_FONT_DEFAULT &lv_font_arimo_ru_16
|
||||
|
||||
#elif defined(TRANSLATIONS_JP)
|
||||
#define LV_FONT_CUSTOM_DECLARE \
|
||||
LV_FONT_DECLARE(lv_font_noto_jp_9) \
|
||||
|
||||
@@ -69,6 +69,9 @@
|
||||
#elif defined(TRANSLATIONS_JP)
|
||||
#include "translations/jp.h"
|
||||
#define LEN_SPECIAL_CHARS 0
|
||||
#elif defined(TRANSLATIONS_RU)
|
||||
#include "translations/ru.h"
|
||||
#define LEN_SPECIAL_CHARS 0
|
||||
#elif defined(TRANSLATIONS_HE)
|
||||
#include "translations/he.h"
|
||||
#define LEN_SPECIAL_CHARS 0
|
||||
@@ -909,6 +912,7 @@ extern const LanguagePack seLanguagePack;
|
||||
extern const LanguagePack skLanguagePack;
|
||||
extern const LanguagePack cnLanguagePack;
|
||||
extern const LanguagePack jpLanguagePack;
|
||||
extern const LanguagePack ruLanguagePack;
|
||||
extern const LanguagePack heLanguagePack;
|
||||
extern const LanguagePack * const languagePacks[];
|
||||
|
||||
|
||||
@@ -16,11 +16,12 @@ chars_fi = u"""åäöÅÄÖ"""
|
||||
chars_it = u"""àù"""
|
||||
chars_pl = u"""ąćęłńóśżźĄĆĘŁŃÓŚŻŹ"""
|
||||
chars_pt = u"""ÁáÂâÃãÀàÇçÉéÊêÍíÓóÔôÕõÚú"""
|
||||
chars_ru = u"""АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"""
|
||||
|
||||
COUNT_EXTRA_CHARS = 21
|
||||
|
||||
chars_extra = u"".join([chr(1+i) for i in range(COUNT_EXTRA_CHARS)])
|
||||
chars = chars_en + chars_extra + chars_fr + chars_da + chars_de + chars_cz + chars_es + chars_fi + chars_it + chars_pl + chars_pt
|
||||
chars = chars_en + chars_extra + chars_fr + chars_da + chars_de + chars_cz + chars_es + chars_fi + chars_it + chars_pl + chars_pt + chars_ru
|
||||
|
||||
|
||||
def createFontBitmap(filename, fontname, fontsize, fontoffset, foreground, background, coordsfile=True):
|
||||
|
||||
@@ -15,7 +15,7 @@ def is_special_char(c):
|
||||
|
||||
def get_special_chars():
|
||||
result = {}
|
||||
for lang in["cn", "cz", "da", "de", "en", "es", "fi", "fr", "he", "it", "jp", "nl", "pl", "pt", "se", "tw"]:
|
||||
for lang in["cn", "cz", "da", "de", "en", "es", "fi", "fr", "he", "it", "jp", "nl", "pl", "pt", "ru", "se", "tw"]:
|
||||
charset = set()
|
||||
tools_path = os.path.dirname(os.path.realpath(__file__))
|
||||
with open(os.path.join(tools_path, "../radio/src/translations/%s.h" % lang), encoding='utf-8') as f:
|
||||
@@ -68,6 +68,7 @@ special_chars_BW = {
|
||||
"it": "àù",
|
||||
"pl": "ąćęłńóśżźĄĆĘŁŃÓŚŻŹ",
|
||||
"pt": "ÁáÂâÃãÀàÇçÉéÊêÍíÓóÔôÕõÚú",
|
||||
"ru": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя",
|
||||
"se": "åäöÅÄÖ",
|
||||
"cn": "",
|
||||
"tw": "",
|
||||
|
||||