Skip to content

Commit

Permalink
Merge pull request #477 from ligenxxxx/optimize-chinese-transation
Browse files Browse the repository at this point in the history
Optimize Chinese translation
  • Loading branch information
ligenxxxx authored Jan 24, 2025
2 parents 8ae0adc + cfb68c1 commit f902168
Show file tree
Hide file tree
Showing 27 changed files with 5,276 additions and 4,098 deletions.
395 changes: 202 additions & 193 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_10.c

Large diffs are not rendered by default.

396 changes: 204 additions & 192 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_12.c

Large diffs are not rendered by default.

403 changes: 209 additions & 194 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_14.c

Large diffs are not rendered by default.

384 changes: 201 additions & 183 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_16.c

Large diffs are not rendered by default.

407 changes: 215 additions & 192 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_18.c

Large diffs are not rendered by default.

415 changes: 221 additions & 194 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_20.c

Large diffs are not rendered by default.

424 changes: 228 additions & 196 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_22.c

Large diffs are not rendered by default.

430 changes: 233 additions & 197 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_24.c

Large diffs are not rendered by default.

440 changes: 241 additions & 199 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_26.c

Large diffs are not rendered by default.

445 changes: 246 additions & 199 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_28.c

Large diffs are not rendered by default.

454 changes: 255 additions & 199 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_30.c

Large diffs are not rendered by default.

442 changes: 251 additions & 191 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_32.c

Large diffs are not rendered by default.

461 changes: 263 additions & 198 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_34.c

Large diffs are not rendered by default.

448 changes: 262 additions & 186 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_36.c

Large diffs are not rendered by default.

474 changes: 278 additions & 196 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_38.c

Large diffs are not rendered by default.

487 changes: 288 additions & 199 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_40.c

Large diffs are not rendered by default.

493 changes: 297 additions & 196 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_42.c

Large diffs are not rendered by default.

503 changes: 307 additions & 196 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_44.c

Large diffs are not rendered by default.

513 changes: 316 additions & 197 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_46.c

Large diffs are not rendered by default.

528 changes: 329 additions & 199 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_48.c

Large diffs are not rendered by default.

345 changes: 176 additions & 169 deletions lib/lvgl/lvgl/src/font/lv_font_montserrat_8.c

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions mkapp/app/language/zh_hans.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ To change image settings, click the Enter button to enter video mode = "单击
Make sure a HDZero VTX or analog VTX is powered on for live video = "确保HDZero VTX或模拟VTX已经运行"
Never = "从不"
min = "分钟"
Reset All = "复位"

; osd
OSD = "OSD"
Expand Down Expand Up @@ -80,7 +81,7 @@ Warning Type = "警报模式"
Beep = "蜂鸣器"
Visual = "屏显"
Both = "同时"
AnalogRx = "模拟模块"
AnalogRX Power = "模拟模块电源"
Auto = "自动"

; fans
Expand Down Expand Up @@ -136,7 +137,7 @@ Invalid Format = "格式无效"
Password Requirements = "密码要求"
Minimum 8 characters = "最少8个字符"
maximum 64 characters = "最多64个字符"
Live stream: = "直播:"
Live stream = "直播"
Connect to the WiFi network identified above = "连接上面标识的WiFi网络"
Use VLC Player to open a Network Stream = "使用VLC播放器打开网络串流"
Apply Settings = "生效设置"
Expand Down Expand Up @@ -237,7 +238,7 @@ Target = "目标"
Current Version = "当前版本"
Reset all settings = "重置所有设置"
Update complete = "更新完成"
Goggle update completed successfully = "Goggle更新完成"
Goggle update completed successfully = "眼镜更新完成"
Please repower goggle now = "现在请重启眼镜"
Settings reset = "重置设置"
All settings have been reset = "所有设置已被重置"
Expand Down Expand Up @@ -291,7 +292,7 @@ Click any button to exit sleep mode = "单击任意按键退出休眠"
Top Fan Speed = "顶风扇速度"
Latency Lock = "延时锁定"
VTX Temp = "VTX 温度"
VRX, Temp = "眼镜温度"
VRX Temp = "眼镜温度"
Battery Low = "电池电压低"
Battery Voltage = "电池电压"
Clock Date = "日期"
Expand All @@ -306,11 +307,19 @@ Antenna 4 = "天线4"
Goggle Temp Top = "眼镜顶部温度"
Goggle Temp Left = "眼镜左侧温度"
Goggle Temp Right = "眼镜右侧温度"
Reset all elements (both modes) = "复位所有元素"
Reset all elements (both modes) = "复位所有元素(所有模式)"
Save changes = "保存修改"
Cancel = "取消"
click to confirm = "单击确认"
scroll to cancel = "转动滚轮取消"
Elements reset = "复位元素"
Pos-X = "X轴坐标"
Pos-Y = "Y轴坐标"

; ui_keyboard
Highlight Key = "切换键"
Select Key = "选择键"
Click = "点击"
Close Keyboard = "关闭键盘"
Hold = "长按"
Erase Text = "清除文本"
2 changes: 1 addition & 1 deletion src/lang/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "core/settings.h"

#define TRANSLATE_STRING_NUM 277
#define TRANSLATE_STRING_NUM 286
#define LANG_FOLDER "/mnt/app/language"

typedef enum {
Expand Down
3 changes: 1 addition & 2 deletions src/ui/page_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ static lv_obj_t *page_power_create(lv_obj_t *parent, panel_arr_t *arr) {

// Batch 2 goggles only
if (getHwRevision() >= HW_REV_2) {
snprintf(buf, sizeof(buf), "%s %s", _lang("AnalogRX"), _lang("Power"));
create_btn_group_item(&btn_group_power_ana, cont, 2, buf, _lang("On"), _lang("Auto"), "", "", ROW_POWER_ANA);
create_btn_group_item(&btn_group_power_ana, cont, 2, _lang("AnalogRX Power"), _lang("On"), _lang("Auto"), "", "", ROW_POWER_ANA);
}

// Back entry
Expand Down
23 changes: 11 additions & 12 deletions src/ui/page_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,22 +357,22 @@ static void page_wifi_update_page_1_notes() {

static char buf[1024];
snprintf(buf, sizeof(buf), "%s:\n %s,%s.\n\n%s:\n 1. %s.\n 2. %s:\n\n rtsp://%s:8554/hdzero\n\n",
_lang("Password Requirements"),
_lang("Minimum 8 characters"),
_lang("maximum 64 characters"),
_lang("Live Stream"),
_lang("Connect to the WiFi network identified above"),
_lang("Use VLC Player to open a Network Stream"),
address ? address : page_wifi.page_2.ip_addr.text);
_lang("Password Requirements"),
_lang("Minimum 8 characters"),
_lang("maximum 64 characters"),
_lang("Live stream"),
_lang("Connect to the WiFi network identified above"),
_lang("Use VLC Player to open a Network Stream"),
address ? address : page_wifi.page_2.ip_addr.text);
lv_label_set_text(page_wifi.page_1.note, buf);
}

static void page_wifi_update_page_3_notes() {
static char buf[256];
snprintf(buf, sizeof(buf), "%s:\n %s,%s.\n\n",
_lang("Password Requirements"),
_lang("Minimum 8 characters"),
_lang("maximum 64 characters"));
_lang("Password Requirements"),
_lang("Minimum 8 characters"),
_lang("maximum 64 characters"));
lv_label_set_text(page_wifi.page_3.note, buf);
}

Expand Down Expand Up @@ -859,7 +859,7 @@ static void page_wifi_on_roller(uint8_t key) {
/**
* Common handling method of the three "apply settings" buttons.
*/
static void page_wifi_handle_apply_button(lv_obj_t* apply_button) {
static void page_wifi_handle_apply_button(lv_obj_t *apply_button) {
if (page_wifi.confirm_settings) {
lv_label_set_text(apply_button, "#FF0000 Updating WiFi...#");
page_wifi_apply_settings_timer = lv_timer_create(page_wifi_apply_settings_timer_cb, 1000, NULL);
Expand Down Expand Up @@ -1016,7 +1016,6 @@ static void page_wifi_on_click(uint8_t key, int sel) {
break;
}


// Enable/Disable panel scrolling when elements are in focus
pp_wifi.p_arr.max =
keyboard_active() || page_wifi.page_2.rf_channel.active
Expand Down
31 changes: 21 additions & 10 deletions src/ui/ui_image_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "core/osd.h"
#include "driver/hardware.h"
#include "driver/oled.h"
#include "lang/language.h"
#include "ui/page_common.h"

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -28,11 +29,13 @@ bool g_bShowIMS = false;
static void ims_page_init(uint8_t *val) {
int16_t x = 30;
int16_t y = 15;
char buf[64];

ims_page.items[0].x = x;
ims_page.items[0].y = y;
ims_page.items[0].type = 1;
strcpy(ims_page.items[0].title, "OLED:");
snprintf(buf, sizeof(buf), "%s:", _lang("OLED"));
strcpy(ims_page.items[0].title, buf);
ims_page.items[0].range[0] = 0;
ims_page.items[0].range[1] = 12;
ims_page.items[0].value = val[0];
Expand All @@ -42,7 +45,8 @@ static void ims_page_init(uint8_t *val) {
ims_page.items[1].x = x;
ims_page.items[1].y = y + 25;
ims_page.items[1].type = 1;
strcpy(ims_page.items[1].title, "Brightness:");
snprintf(buf, sizeof(buf), "%s:", _lang("Brightness"));
strcpy(ims_page.items[1].title, buf);
ims_page.items[1].range[0] = 0;
ims_page.items[1].range[1] = 78;
ims_page.items[1].value = val[1];
Expand All @@ -51,7 +55,8 @@ static void ims_page_init(uint8_t *val) {
ims_page.items[2].x = x;
ims_page.items[2].y = y + 50;
ims_page.items[2].type = 1;
strcpy(ims_page.items[2].title, "Saturation:");
snprintf(buf, sizeof(buf), "%s:", _lang("Saturation"));
strcpy(ims_page.items[2].title, buf);
ims_page.items[2].range[0] = 0;
ims_page.items[2].range[1] = 47;
ims_page.items[2].value = val[2];
Expand All @@ -60,7 +65,8 @@ static void ims_page_init(uint8_t *val) {
ims_page.items[3].x = x;
ims_page.items[3].y = y + 75;
ims_page.items[3].type = 1;
strcpy(ims_page.items[3].title, "Contrast:");
snprintf(buf, sizeof(buf), "%s:", _lang("Contrast"));
strcpy(ims_page.items[3].title, buf);
ims_page.items[3].range[0] = 0;
ims_page.items[3].range[1] = 47;
ims_page.items[3].value = val[3];
Expand All @@ -69,7 +75,8 @@ static void ims_page_init(uint8_t *val) {
ims_page.items[4].x = x;
ims_page.items[4].y = y + 100;
ims_page.items[4].type = 1;
strcpy(ims_page.items[4].title, "OLED Auto off:");
snprintf(buf, sizeof(buf), "OLED %s:", _lang("Auto off"));
strcpy(ims_page.items[4].title, buf);
ims_page.items[4].range[0] = 0;
ims_page.items[4].range[1] = 4;
ims_page.items[4].value = val[4];
Expand All @@ -78,20 +85,22 @@ static void ims_page_init(uint8_t *val) {
ims_page.items[5].x = x;
ims_page.items[5].y = y + 125;
ims_page.items[5].type = 0;
strcpy(ims_page.items[5].title, "< Back");
snprintf(buf, sizeof(buf), "< %s", _lang("Back"));
strcpy(ims_page.items[5].title, buf);
ims_page.items[5].state = 0;

ims_page.items[6].x = x + 200;
ims_page.items[6].y = y + 125;
ims_page.items[6].type = 0;
strcpy(ims_page.items[6].title, "Reset All");
snprintf(buf, sizeof(buf), "%s", _lang("Reset All"));
strcpy(ims_page.items[6].title, buf);
ims_page.items[6].state = 0;
}

static void show_ims_slider(uint8_t index) {
ims_slider_t *p_slider = &ims_page.items[index];

char buf[16];
char buf[32];
lv_point_t points[2];

if (p_slider->state == 0) { // 0=not selected, 1=selected, 2=slider bar selected
Expand All @@ -112,8 +121,10 @@ static void show_ims_slider(uint8_t index) {

switch (index) {
case 4: { // auto off
char *str_ao[5] = {"1 min", "3 min", "5 min", "7 min", "Never"};
strcpy(buf, str_ao[p_slider->value]);
if (p_slider->value == 4)
snprintf(buf, sizeof(buf), "%s", _lang("Never"));
else
snprintf(buf, sizeof(buf), "%d %s", (p_slider->value << 1) + 1, _lang("min"));
break;
}

Expand Down
9 changes: 6 additions & 3 deletions src/ui/ui_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "core/common.hh"
#include "core/osd.h"
#include "lang/language.h"
#include "ui/page_common.h"
#include "ui/ui_style.h"

Expand Down Expand Up @@ -86,6 +87,7 @@ static void keyboard_update(uint8_t key) {
* External Functions
*/
void keyboard_init() {
char buf[128];
if (!g_keyboard.input || !g_keyboard.text) {
char filename[128];

Expand Down Expand Up @@ -121,7 +123,7 @@ void keyboard_init() {

g_keyboard.dial_scroll_text = lv_label_create(lv_scr_act());
lv_obj_add_style(g_keyboard.dial_scroll_text, &style_rootmenu, LV_PART_MAIN);
lv_label_set_text(g_keyboard.dial_scroll_text, "Highlight Key");
lv_label_set_text(g_keyboard.dial_scroll_text, _lang("Highlight Key"));
lv_obj_set_style_text_font(g_keyboard.dial_scroll_text, &lv_font_montserrat_26, 0);
lv_obj_set_style_text_align(g_keyboard.dial_scroll_text, LV_TEXT_ALIGN_LEFT, 0);
lv_obj_set_pos(g_keyboard.dial_scroll_text, 620, 130);
Expand All @@ -136,7 +138,7 @@ void keyboard_init() {

g_keyboard.dial_click_text = lv_label_create(lv_scr_act());
lv_obj_add_style(g_keyboard.dial_click_text, &style_rootmenu, LV_PART_MAIN);
lv_label_set_text(g_keyboard.dial_click_text, "Select Key");
lv_label_set_text(g_keyboard.dial_click_text, _lang("Select Key"));
lv_obj_set_style_text_font(g_keyboard.dial_click_text, &lv_font_montserrat_26, 0);
lv_obj_set_style_text_align(g_keyboard.dial_click_text, LV_TEXT_ALIGN_LEFT, 0);
lv_obj_set_pos(g_keyboard.dial_click_text, 1020, 130);
Expand All @@ -152,7 +154,8 @@ void keyboard_init() {

g_keyboard.right_button_text = lv_label_create(lv_scr_act());
lv_obj_add_style(g_keyboard.right_button_text, &style_rootmenu, LV_PART_MAIN);
lv_label_set_text(g_keyboard.right_button_text, "Click: Close Keyboard\nHold: Erase Text");
snprintf(buf, sizeof(buf), "%s: %s\n%s: %s", _lang("Click"), _lang("Close Keyboard"), _lang("Hold"), _lang("Erase Text"));
lv_label_set_text(g_keyboard.right_button_text, buf);
lv_obj_set_style_text_font(g_keyboard.right_button_text, &lv_font_montserrat_26, 0);
lv_obj_set_style_text_align(g_keyboard.right_button_text, LV_TEXT_ALIGN_LEFT, 0);
lv_obj_set_pos(g_keyboard.right_button_text, 1360, 116);
Expand Down

0 comments on commit f902168

Please sign in to comment.