Skip to content

Commit

Permalink
added support for Russian and a font-copy script
Browse files Browse the repository at this point in the history
  • Loading branch information
Sat1l committed Dec 28, 2024
1 parent 42457ea commit e5ca189
Show file tree
Hide file tree
Showing 27 changed files with 163,860 additions and 14,504 deletions.
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 = "扫频完成后, 使用滚轮选择信道并按下确认键进入"
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. = "单击确认键进入视频模式以修改图像设置. \n确保HDZero VTX或模拟VTX已经运行"
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某些元素在正常运行下可能不会显示,这取决于信号源和其它条件.\nOSD元素基于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 = "*如果自动扫频设置为'上一次',眼镜将默认显示上一次的信道"

; 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 пароль"
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"
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

0 comments on commit e5ca189

Please sign in to comment.