Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Russian language #470

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ media.tar.gz
/.vscode/settings.json
.DS_Store
utilities/font/out
.vscode/settings.json
3,013 changes: 2,370 additions & 643 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_10.c

Large diffs are not rendered by default.

3,425 changes: 2,780 additions & 645 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_12.c

Large diffs are not rendered by default.

3,731 changes: 3,085 additions & 646 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_14.c

Large diffs are not rendered by default.

4,208 changes: 3,560 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_16.c

Large diffs are not rendered by default.

4,589 changes: 3,941 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_18.c

Large diffs are not rendered by default.

5,023 changes: 4,375 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_20.c

Large diffs are not rendered by default.

5,555 changes: 4,907 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_22.c

Large diffs are not rendered by default.

6,147 changes: 5,499 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_24.c

Large diffs are not rendered by default.

6,737 changes: 6,089 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_26.c

Large diffs are not rendered by default.

7,437 changes: 6,790 additions & 647 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_28.c

Large diffs are not rendered by default.

8,159 changes: 7,511 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_30.c

Large diffs are not rendered by default.

8,898 changes: 8,250 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_32.c

Large diffs are not rendered by default.

9,801 changes: 9,153 additions & 648 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_34.c

Large diffs are not rendered by default.

10,854 changes: 10,082 additions & 772 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_36.c

Large diffs are not rendered by default.

11,621 changes: 10,847 additions & 774 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_38.c

Large diffs are not rendered by default.

13,147 changes: 12,380 additions & 767 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_40.c

Large diffs are not rendered by default.

14,114 changes: 13,334 additions & 780 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_42.c

Large diffs are not rendered by default.

15,125 changes: 14,343 additions & 782 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_44.c

Large diffs are not rendered by default.

16,259 changes: 15,477 additions & 782 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_46.c

Large diffs are not rendered by default.

17,412 changes: 16,629 additions & 783 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_48.c

Large diffs are not rendered by default.

2,757 changes: 2,118 additions & 639 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_8.c

Large diffs are not rendered by default.

306 changes: 306 additions & 0 deletions mkapp/app/language/ru_ru.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,306 @@
SD Card = "SD-карта"
Off = "Выкл."
On = "Вкл."
In = "Вход"
Expansion Module = "Модуль расширения"
Integrity check = "Проверка целостности"
Unsupported = "Неподдерживается"
No SD Card = "Нет SD-карты"
Searching = "WiFi: поиск"
RF = "RF"
clip(s) = "Клип(ы)"
full = "Полный"
available = "Доступно"

; scan now
Scan Now = "Сканировать"
Scan Ready = "Сканирование готово"
When scanning is complete, use the\n dial to select a channel and press\n the Enter button to choose = "Когда сканирование завершится, используйте\n колесо для выбора канала и нажмите\n Enter для выбора"
Scanning = "Сканирование"
Scanning done = "Сканирование завершено"
Scanning ready = "Сканирование готово"

; source
Source = "Источник"
Expansion Module = "Модуль расширения"
Analog Video = "Аналог. видео"
HDZero Band = "Сетка HDZero"
Raceband = "Raceband"
Lowband = "Lowband"
HDZero BW = "HDZero BW"
Wide = "Широкая"
Narrow = "Узкая"
Back = "Назад"
Detected = "00FF00 Обнаружено"
Disconnected = "C0C0C0 Не подключено"

; image setting
Image Setting = "Изображение"
Brightness = "Яркость"
Saturation = "Насыщенность"
Contrast = "Контраст"
Auto Off = "Авто выкл."
To change image settings, click the Enter button to enter video mode. \nMake sure a HDZero VTX or analog VTX is powered on for live video. = "Чтобы изменить настройки изображения, нажмите Enter для входа в видеорежим. \nУбедитесь, что есть доступный сигнал HDZero или аналога для лайв просмотра"
Never = "Никогда"
min = "Мин."

; osd
OSD = "OSD"
Adjust OSD Elements = "Настр. эл-тов OSD"
Orbit = "Орбита"
Mode = "Режим"
Min = "Мин."
Max = "Макс."
At Startup = "При вкл."
Show = "Показать"
Hide = "Скрыть"
Last = "Последн."
Note: The positioning preview will display all OSD elements. Some elements might\nnot show during normal operation, depending on input source and conditions.\nOSD Element positioning is based on a 1280x720 canvas.\nPositions can be set for 4x3 and 16x9 modes separately,\nthe Show Element toggle is shared between both modes. = "Заметка: Предпросмотр позиционирования отобразит все элементы OSD. Некоторые элементы могут\nне отображаться во время нормальной работы, в зависимости от источника ввода и условий.\nПозиционирование элементов OSD основано на разрешении 1280x720.\nПозиции могут быть установлены для режимов 4x3 и 16x9 отдельно,\nпереключатель отображения элемента общий для обоих режимов."

; power
Power = "Питание"
Battery = "Аккумулятор"
Cell Mode = "Подсч. ячеек"
Manual = "Ручной"
Cell Count = "Количество ячеек"
Warning Cell Voltage = "Порог напр. ячейки"
Voltage Calibration = "Калибровка напр."
Display Mode = "Отображение"
Total = "Общее"
Cell Avg. = "Среднее"
Warning Type = "Предупреждение"
Beep = "Звук"
Visual = "Визуа"
Both = "Оба"
AnalogRX = "Аналог"
Auto = "Авто"

; fans
Fans = "Вентиляторы"
Auto Control = "Авто"
Top Fan = "Верхний вентилятор"
Side Fans = "Боковой вентилятор"

; record
Record Option = "Запись"
Record Mode = "Режим записи"
Record Format = "Формат записи"
Record OSD = "Запись OSD"
Record Audio = "Запись аудио"
Audio Source = "Источник аудио"
Naming Scheme = "Схема названий"
Yes = "Да"
No = "Нет"
Mic = "Микро"
Line In = "Лин. вход"
A/V In = "A/V вход"
Digits = "Цифры"
Date = "Дата"
MP4 format requires properly closing files or the files will be corrupt. \nTS format is highly recommended. = "MP4 требует завершения записи, иначе файл может быть поврежден. \nРекомендуется использовать TS."

; auto scan
Auto Scan = "Автоскан"
Default = "По умолчанию"
Expansion = "Модуль"
AV In = "AV вход"
HDMI In = "HDMI"
*if Auto Scan is 'Last', goggles will default to show last tuned channel = "*Если автоскан установлен на .Последний., \n очки будут показывать последний настроенный канал"

; elrs
ELRS = "ELRS"
Send = "Отправить"
Bind = "Бинд"
Click to start = "Нажмите для начала"
* Press right button to cancel binding = "* Нажмите правую кнопку для отмены бинда"
Starting... = "Запуск..."
FAILED = "ОШИБКА"
Success = "Успешно"
Binding... = "Бинд..."
Timeout = "Таймаут"
Cancelled = "Отменено"
Backpack = "Backpack"

; wifi module
WiFi Module = "WiFi модуль"
Invalid Too Short = "Слишком коротко"
Invalid Format = "Неверный формат"
Password Requirements = "Требования к паролю"
Minimum 8 characters = "Минимум 8 символов"
maximum 64 characters = "Максимум 64 символа"
Live stream: = "Трансляция:"
Connect to the WiFi network identified above = "Подключитесь к вышеуказанной сети WiFi"
Use VLC Player to open a Network Stream = "Используйте VLC Player просмотра трансляции"
Apply Settings = "Применить настройки"
Enable = "Включить"
Host = "Хост"
Client = "Клиент"
Password = "Пароль"
Address = "Адрес"
Netmask = "Нетмаск"
Gateway = "Шлюз"
RF Channel = "RF канал"
Root PW = "Root pw"
Page = "Страница"
Basic = "Базовая"
Advanced = "Расшир."
System = "Система"
Updating WiFi = "Обновление WiFi"
Click to confirm or Scroll to cancel = "Нажмите для подтверждения или прокрутите для отмены"

; head tracker
Head Tracker = "Трекер головы"
Set Alarm Angle = "Установить пред. угол"
Tracking = "Трекинг"
Tilt Alarm = "Пред. наклона"
Alarm = "Предупреждение"
Video = "Видео"
Arm = "Включить"
Calibrate = "Калибровать"
Set Center = "Установить центр"
Max Angle = "Макс. угол"
Pan = "Панорама"
Tilt = "Наклон"
Roll = "Крен"
Calibrating = "Калибровка"
Re-calibrate = "Перекалибровать"
Updating Angle = "Обновление угла"

; playback
Playback = "Воспроизв"
Long press the Enter button to exit = "Долгое нажатие Enter для выхода"
Long press the Func button to delete = "Долгое нажатие Func для удаления"

; storage
Storage = "Хранилище"
Format SD Card = "Форматировать SD-карту"
Repair SD Card = "Восстановить SD-карту"
Clear DVR Folder = "Очистить папку DVR"
Format was successful = "Форматирование прошло успешно"
Format has failed = "Не удалось форматировать"
Press click to exit = "Нажмите для выхода"
Please insert a SD Card = "Пожалуйста, вставьте SD-карту"
Failed to extract results = "Не удалось извлечь результаты"
Failed to access results = "Не удалось получить доступ к результатам"
Failed to generate results = "Не удалось сгенерировать результаты"
Failed to start format = "Не удалось начать форматирование"
Unsupported status code = "Неподдерживаемый код результата"
SD Card Format Status = "Статус форматирования SD-карты"
Filesystem is OK = "Файловая система в порядке"
Filesystem was modified and fixed = "Файловая система была изменена и исправлена"
Failed to remount SD Card = "Не удалось повторно смонтировать SD-карту"
Failed to start repair = "Не удалось начать восстановление"
SD Card Repair Status = "Статус восстановления SD-карты"
Logging = "Логирование"
Self-Test is enabled = "Самопроверка включена"
All storage options are disabled = "Все варианты хранения отключены"
Detected files being accessed by SD Card = "Обнаружены файлы, к которым обращается SD-карта"
Remove the following files from the SD Card and try again = "Удалите следующие файлы с SD-карты и повторите попытку"
Status = "Статус"
None = "Нет"
Formating = "Форматирование"
Repairing = "Восстановление"
Removing = "Удаление"
Done = "Готово"
SD Card integrity check is active = "Идет проверка целостности SD-карты"
controls are disabled until process has completed = "управление отключено до завершения процесса"

; firmware
Firmware = "Прошивка"
Flashing = "Обновление"
SUCCESS = "УСПЕХ"
Verification failed, try it again = "Не удалось проверить, попробуйте еще раз"
No firmware found = "Прошивка не найдена"
Failed, check connection = "Ошибка, проверьте подключение..."
WAIT = "ОЖИДАНИЕ"
DO NOT POWER OFF = "НЕ ВЫКЛЮЧАТЬ"
Multiple versions been found = "Найдено несколько версий"
Keep only one = "Оставьте только одну"
To view release notes = "Для просмотра релизноута"
select either Update VTX or Update Goggle = "выберите обновление VTX или Очков"
then press the Func button to display or hide the release notes = "Потом нажмите кнопку Func для отображения или скрытия релилизноута"
Remove HDZERO_TX or HDZERO_GOGGLE binary files from the root of\nSD Card in order to install the latest online downloaded firmware files = "从 SD 卡根目录中删除 HDZERO_TX 或 HDZERO_GOGGLE 二进制文件, 以安装最新的在线下载的固件"
Visit https://github.com/hdzero for the complete list of changes = "Посетите https://github.com/hdzero для полного списка изменений"
Release Notes = "Релизноут"
not found = "не найдено"
Update = "Обновить"
Target = "Цель"
Firmware = "Прошивка"
Current Version = "Текущая версия"
Reset all settings = "Сбросить все настройки"
Update complete = "Обновление завершено"
Goggle update completed successfully.\nPlease repower goggle now. = "Обновление очков завершено.\nПожалуйста, перезагрузите очки."
Settings reset = "Сброс настроек"
All settings have been reset.\nPlease repower goggle now. = "Все настройки сброшены.\nПожалуйста, перезагрузите очки."
Empty = "Пусто"
Goggle = "Очки"

; focus chart
Focus Chart = "Фокус"
Click the Enter Button to display the Back Focusing Chart = "Нажмите Enter для отображения фокусной шкалы"
Click the Enter Button again to exit = "Нажмите Enter чтобы выйти"

; clock
Clock = "Время"
Set Clock = "Установить время"
Format = "Формат"
AM = "AM"
PM = "PM"
24 Hour = "24 часа"
Battery not installed or clock not configured = "Батарея не установлена или время не настроено"

; input
Input = "Кнопки"
Roller = "Ролик"
Left short = "Лев. кор"
Left long = "Лев. дл"
Right short = "Прав кор"
Right long = "Прав дл"
Right double = "Прав дв"
Toggle OSD = "Перекл. OSD"
Main menu = "Осн. меню"
Toggle DVR = "Перекл. DVR"
Center HT = "Центр HT"
Calibrate HT = "Калибр. HT"
Toggle fan speed = "Перекл. скор. вент."
Star DVR = "Старт DVR"
Toggle source = "Перекл. источник"
Cycle source = "След. источник"
Switch channel = "Сменить канал"
Change fan speed = "Изменить скор. вент."
OLED Brightness = "Яркость OLED"
Settings apply to video mode only = "Настройки применяются только для видеорежима"
'Toggle source' will switch between HDZero and Expansion module = "'След. источник' переключает между HDZero и модулем расширения"

; go sleep
Go Sleep = "Иди спать"
Go Sleep! = "Иди спать!"
Click the Enter Button to go sleep = "Нажмите Enter, чтобы уйти в спящий режим"
Click any button to exit sleep mode = "Нажмите любую кнопку для выхода"

; ui osd element pos
Top Fan Speed = "Скорость верхнего вентилятора"
Latency Lock = "Фиксированная задержка"
VTX Temp = "Температура VTX"
VRX, Temp = "температура VRX"
Battery Low = "Низкое напряжение батареи"
Battery Voltage = "Напряжение батареи"
Clock Date = "Дата"
Clock Time = "Время"
Channel = "Канал"
DVR = "DVR"
VLQ = "Качество видеосигнала"
Antenna 1 = "Антенна 1"
Antenna 2 = "Антенна 2"
Antenna 3 = "Антенна 3"
Antenna 4 = "Антенна 4"
Goggle Temp Top = "Температура очков, верх"
Goggle Temp Left = "Температура очков, лево"
Goggle Temp Right = "Температура очков, право"
Reset all elements (both modes) = "Сбросить все элементы (оба режима)"
Save changes = "Сохранить изменения"
Cancel = "Отмена"
click to confirm = "Нажмите для подтверждения"
scroll to cancel = "Прокрутите для отмены"
Elements reset = "Сбросить элементы"
Pos-X = "Пол. X"
Pos-Y = "Пол. Y"
2 changes: 1 addition & 1 deletion mkapp/app/language/zh_hans.ini
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Warning Type = "警报模式"
Beep = "蜂鸣器"
Visual = "屏显"
Both = "同时"
AnalogRx = "模拟模块"
AnalogRX = "模拟模块"
Auto = "自动"

; fans
Expand Down
20 changes: 11 additions & 9 deletions src/lang/language.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,40 @@

struct Language {
lang_e lang;
const char * const code;
const char * const name;
const char *const code;
const char *const name;
const translate_t *translations;
};

static struct Language languages[] = {
{LANG_ENGLISH_DEFAULT, "en_us", "English", NULL},
{LANG_SIMPLIFIED_CHINESE, "zh_hans", "Simplified Chinese", NULL},
{LANG_RUSSIAN, "ru_ru", "Russian", NULL},
};

const char *language_config_file[] = {
// uppercase
"ENG.TXT",
"CHN.TXT",
"RUS.TXT",
};

struct CallbackPayload {
translate_t translations[TRANSLATE_STRING_NUM];
size_t index;
};

int init_callback(const char* section, const char* key, const char* value, void* userData) {
struct CallbackPayload* payload = userData;
int init_callback(const char *section, const char *key, const char *value, void *userData) {
struct CallbackPayload *payload = userData;

assert(key != NULL);
assert(value != NULL);

const size_t englishLength = strlen(key);
const size_t translateLength = strlen(value);

char* englishBuffer = malloc(englishLength + 1);
char* translateBuffer = malloc(translateLength + 1);
char *englishBuffer = malloc(englishLength + 1);
char *translateBuffer = malloc(translateLength + 1);

strncpy(englishBuffer, key, englishLength);
strncpy(translateBuffer, value, translateLength);
Expand Down Expand Up @@ -72,7 +74,7 @@ void language_init() {
}

// Load translations
translate_t* translations = malloc(TRANSLATE_STRING_NUM * sizeof(translate_t));
translate_t *translations = malloc(TRANSLATE_STRING_NUM * sizeof(translate_t));
struct CallbackPayload payload = {.index = 0};
ini_browse(init_callback, &payload, fileName);

Expand All @@ -92,11 +94,11 @@ const char *translate_string(const char *str, lang_e lang) {
if (lang == LANG_ENGLISH_DEFAULT || lang >= LANG_END)
return str;

const struct Language * const language = &languages[lang];
const struct Language *const language = &languages[lang];
const size_t keyLength = strlen(str);
// search str translate
for (int i = 0; i < TRANSLATE_STRING_NUM; i++) {
const translate_t * const translation = &language->translations[i];
const translate_t *const translation = &language->translations[i];

if (translation->in_english == NULL || translation->in_english[0] == '\0')
continue;
Expand Down
Loading