From 870e205a2a68962cdf1469b0b2776617cb77a6d3 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:47:16 +0800 Subject: [PATCH 1/7] fix zh_hans.ini --- mkapp/app/language/zh_hans.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkapp/app/language/zh_hans.ini b/mkapp/app/language/zh_hans.ini index 81c850d2..94c93528 100644 --- a/mkapp/app/language/zh_hans.ini +++ b/mkapp/app/language/zh_hans.ini @@ -31,8 +31,8 @@ HDZero BW = "HDZero带宽" Wide = "宽带" Narrow = "窄带" Back = "返回" -Detected = "00FF00 已连接" -Disconnected = "C0C0C0 未连接" +Detected = "已连接" +Disconnected = "未连接" ; image setting Image Setting = "图像设置" From 0fca22052fac4837a414f7a4f417624cafbbc2f0 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:05:39 +0800 Subject: [PATCH 2/7] fix zh_hans.ini --- mkapp/app/language/zh_hans.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkapp/app/language/zh_hans.ini b/mkapp/app/language/zh_hans.ini index 94c93528..dcabd525 100644 --- a/mkapp/app/language/zh_hans.ini +++ b/mkapp/app/language/zh_hans.ini @@ -31,7 +31,7 @@ HDZero BW = "HDZero带宽" Wide = "宽带" Narrow = "窄带" Back = "返回" -Detected = "已连接" +Connected = "已连接" Disconnected = "未连接" ; image setting From ee62aa7c600d4d0a4e90e8bfa2f76a83da2efe3d Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:36:15 +0800 Subject: [PATCH 3/7] Remove \n from lang --- mkapp/app/language/zh_hans.ini | 24 +++++++++++++++++------- src/ui/page_imagesettings.c | 5 ++++- src/ui/page_osd.c | 8 +++++++- src/ui/page_record.c | 5 ++++- src/ui/page_scannow.c | 9 ++++++++- src/ui/page_version.c | 14 +++++++++++--- 6 files changed, 51 insertions(+), 14 deletions(-) diff --git a/mkapp/app/language/zh_hans.ini b/mkapp/app/language/zh_hans.ini index dcabd525..e69bfa01 100644 --- a/mkapp/app/language/zh_hans.ini +++ b/mkapp/app/language/zh_hans.ini @@ -15,7 +15,9 @@ 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 = "扫频完成后, 使用滚轮选择信道并按下确认键进入" +When scanning is complete, use the = "扫频完成后, 使用滚轮选择信道并按下确认键进入" +dial to select a channel and press = " " +the Enter button to choose = " " Scanning = "扫频中" Scanning done = "扫频完成" Scanning ready = "扫频就绪" @@ -40,7 +42,8 @@ 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已经运行" +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 = "分钟" @@ -55,7 +58,11 @@ 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元素的显示与隐藏在两种模式下一样." +Note: The positioning preview will display all OSD elements. Some elements might = "注意: OSD预览会显示所有元素." +not show during normal operation, depending on input source and conditions = "某些元素在正常运行下可能不会显示,这取决于信号源和其它条件" +OSD Element positioning is based on a 1280x720 canvas = "OSD元素基于1280x720画布进行定位." +Positions can be set for 4x3 and 16x9 modes separately = "可以分别在4x3和16x9模式下设置位置." +the Show Element toggle is shared between both modes = "元素的显示与隐藏在两种模式下一样." ; power Power = "电源" @@ -96,7 +103,8 @@ 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格式." +MP4 format requires properly closing files or the files will be corrupt = "MP4格式在录制过程中掉电会导致文件损坏." +TS format is highly recommended = "强烈建议使用TS格式." ; auto scan Auto Scan = "自动扫频" @@ -218,7 +226,8 @@ 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 = "然后按下功能键显示或者隐藏发布信息" -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 二进制文件, 以安装最新的在线下载的固件" +Remove HDZERO_TX or HDZERO_GOGGLE binary files from the root of = "从 SD 卡根目录中删除 HDZERO_TX 或 HDZERO_GOGGLE 二进制文件, 以安装最新的在线下载的固件" +SD Card in order to install the latest online downloaded firmware files = " " Visit https://github.com/hdzero for the complete list of changes = "请访问 https://github.com/hdzero 获取完整的更改列表" Release Notes = "发布信息" not found = "没有找到" @@ -228,9 +237,10 @@ Firmware = "固件" Current Version = "当前版本" Reset all settings = "重置所有设置" Update complete = "更新完成" -Goggle update completed successfully.\nPlease repower goggle now. = "Goggle更新完成.\n现在请重启眼镜." +Goggle update completed successfully = "Goggle更新完成" +Please repower goggle now = "现在请重启眼镜" Settings reset = "重置设置" -All settings have been reset.\nPlease repower goggle now. = "所有设置已被重置.\n现在请重启眼镜." +All settings have been reset = "所有设置已被重置" Empty = "无" Goggle = "眼镜" diff --git a/src/ui/page_imagesettings.c b/src/ui/page_imagesettings.c index 78dd4ac5..ada32bcf 100644 --- a/src/ui/page_imagesettings.c +++ b/src/ui/page_imagesettings.c @@ -64,7 +64,10 @@ static lv_obj_t *page_imagesettings_create(lv_obj_t *parent, panel_arr_t *arr) { create_label_item(cont, buf, 1, 5, 1); lv_obj_t *label2 = lv_label_create(cont); - lv_label_set_text(label2, _lang("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.")); + snprintf(buf, sizeof(buf), "%s.\n %s.", + _lang("To change image settings, click the Enter button to enter video mode"), + _lang("Make sure a HDZero VTX or analog VTX is powered on for live video")); + lv_label_set_text(label2, buf); lv_obj_set_style_text_font(label2, &lv_font_montserrat_16, 0); lv_obj_set_style_text_align(label2, LV_TEXT_ALIGN_LEFT, 0); lv_obj_set_style_text_color(label2, lv_color_make(255, 255, 255), 0); diff --git a/src/ui/page_osd.c b/src/ui/page_osd.c index 6220e729..63398e24 100644 --- a/src/ui/page_osd.c +++ b/src/ui/page_osd.c @@ -72,7 +72,13 @@ static lv_obj_t *page_osd_create(lv_obj_t *parent, panel_arr_t *arr) { create_label_item(cont, buf, 1, ROW_BACK, 1); lv_obj_t *label_user_hint = lv_label_create(cont); - lv_label_set_text(label_user_hint, _lang("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.")); + snprintf(buf, sizeof(buf), "%s\n%s.\n%s,\n%s.\n%s.", + _lang("Note: The positioning preview will display all OSD elements. Some elements might"), + _lang("not show during normal operation, depending on input source and conditions"), + _lang("OSD Element positioning is based on a 1280x720 canvas"), + _lang("Positions can be set for 4x3 and 16x9 modes separately"), + _lang("the Show Element toggle is shared between both modes")); + lv_label_set_text(label_user_hint, buf); lv_obj_set_style_text_font(label_user_hint, &lv_font_montserrat_16, 0); lv_obj_set_style_text_align(label_user_hint, LV_TEXT_ALIGN_LEFT, 0); lv_obj_set_style_text_color(label_user_hint, lv_color_make(255, 255, 255), 0); diff --git a/src/ui/page_record.c b/src/ui/page_record.c index 30a4af73..7d184fe2 100644 --- a/src/ui/page_record.c +++ b/src/ui/page_record.c @@ -83,7 +83,10 @@ static lv_obj_t *page_record_create(lv_obj_t *parent, panel_arr_t *arr) { btn_group_set_sel(&btn_group_file_naming, g_setting.record.naming); lv_obj_t *label2 = lv_label_create(cont); - lv_label_set_text(label2, _lang("MP4 format requires properly closing files or the files will be corrupt. \nTS format is highly recommended.")); + snprinrf(buf, sizeof(buf), "%s.\n%s.", + _lang("MP4 format requires properly closing files or the files will be corrupt"), + _lang("TS format is highly recommended")); + lv_label_set_text(label2, buf); lv_obj_set_style_text_font(label2, &lv_font_montserrat_16, 0); lv_obj_set_style_text_align(label2, LV_TEXT_ALIGN_LEFT, 0); lv_obj_set_style_text_color(label2, lv_color_make(255, 255, 255), 0); diff --git a/src/ui/page_scannow.c b/src/ui/page_scannow.c index 58926a28..7ab77950 100644 --- a/src/ui/page_scannow.c +++ b/src/ui/page_scannow.c @@ -193,6 +193,8 @@ void page_scannow_set_channel_label(void) { // 1420-256 // 1164 static lv_obj_t *page_scannow_create(lv_obj_t *parent, panel_arr_t *arr) { + char buf[256]; + lv_obj_t *page = lv_menu_page_create(parent, NULL); lv_obj_clear_flag(page, LV_OBJ_FLAG_SCROLLABLE); lv_obj_set_size(page, 1158, 900); @@ -233,7 +235,12 @@ static lv_obj_t *page_scannow_create(lv_obj_t *parent, panel_arr_t *arr) { LV_GRID_ALIGN_CENTER, 0, 1); lv_obj_t *label2 = lv_label_create(cont1); - lv_label_set_text(label2, _lang("When scanning is complete, use the\n dial to select a channel and press\n the Enter button to choose")); + snprintf(setting_key, sizeof(setting_key), "element_%s_pos_16_9_x", config_name); + snprintf(buf, sizeof(buf), "%s\n %s\n %s", + _lang("When scanning is complete, use the"), + _lang("dial to select a channel and press"), + _lang("the Enter button to choose")); + lv_label_set_text(label2, buf); lv_obj_set_style_text_font(label2, &lv_font_montserrat_26, 0); lv_obj_set_style_text_align(label2, LV_TEXT_ALIGN_LEFT, 0); lv_obj_set_style_text_color(label2, lv_color_make(255, 255, 255), 0); diff --git a/src/ui/page_version.c b/src/ui/page_version.c index a1330872..bbb3b482 100644 --- a/src/ui/page_version.c +++ b/src/ui/page_version.c @@ -510,7 +510,9 @@ static void page_version_fw_scan_for_updates() { _lang("then press the Func button to display or hide the release notes")); lv_label_set_text(label_note, buf); } else if (fw_select_goggle.alt_title || fw_select_vtx.alt_title) { - snprintf(buf, sizeof(buf), "%s.", _lang("Remove HDZERO_TX or HDZERO_GOGGLE binary files from the root of\nSD Card in order to install the latest online downloaded firmware files")); + snprintf(buf, sizeof(buf), "%s\n%s.", + _lang("Remove HDZERO_TX or HDZERO_GOGGLE binary files from the root of"), + _lang("SD Card in order to install the latest online downloaded firmware files")); lv_label_set_text(label_note, buf); } } else { @@ -834,10 +836,16 @@ static lv_obj_t *page_version_create(lv_obj_t *parent, panel_arr_t *arr) { LV_GRID_ALIGN_CENTER, ROW_UPDATE_ESP32, 1); lv_obj_add_flag(bar_esp, LV_OBJ_FLAG_HIDDEN); - msgbox_update_complete = create_msgbox_item(_lang("Update complete"), _lang("Goggle update completed successfully.\nPlease repower goggle now.")); + snprintf(buf, sizeof(buf), "%s.\n%s.", + _lang("Goggle update completed successfully"), + _lang("Please repower goggle now")); + msgbox_update_complete = create_msgbox_item(_lang("Update complete"), buf); lv_obj_add_flag(msgbox_update_complete, LV_OBJ_FLAG_HIDDEN); - msgbox_settings_reset = create_msgbox_item(_lang("Settings reset"), _lang("All settings have been reset.\nPlease repower goggle now.")); + snprintf(buf, sizeof(buf), "%s.\n%s.", + _lang("All settings have been reset"), + _lang("Please repower goggle now")); + msgbox_settings_reset = create_msgbox_item(_lang("Settings reset"), buf); lv_obj_add_flag(msgbox_settings_reset, LV_OBJ_FLAG_HIDDEN); msgbox_release_notes = create_msgbox_item(_lang("Release Notes"), _lang("Empty")); From 73fb5673e95126dfb0508fd325c39c4f276c35cf Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:43:29 +0800 Subject: [PATCH 4/7] include stdio on page_record.c --- src/ui/page_record.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/page_record.c b/src/ui/page_record.c index 7d184fe2..b0b7cef2 100644 --- a/src/ui/page_record.c +++ b/src/ui/page_record.c @@ -1,5 +1,6 @@ #include "page_record.h" +#include #include #include From fa8b885715f841f08d6202996fbc1ccf06ca0de8 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:46:13 +0800 Subject: [PATCH 5/7] fix typo --- src/ui/page_record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/page_record.c b/src/ui/page_record.c index b0b7cef2..529b35bc 100644 --- a/src/ui/page_record.c +++ b/src/ui/page_record.c @@ -84,7 +84,7 @@ static lv_obj_t *page_record_create(lv_obj_t *parent, panel_arr_t *arr) { btn_group_set_sel(&btn_group_file_naming, g_setting.record.naming); lv_obj_t *label2 = lv_label_create(cont); - snprinrf(buf, sizeof(buf), "%s.\n%s.", + snprintf(buf, sizeof(buf), "%s.\n%s.", _lang("MP4 format requires properly closing files or the files will be corrupt"), _lang("TS format is highly recommended")); lv_label_set_text(label2, buf); From 44ddc2c0609a9e368c8014c7b944ca8caa06ee12 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:51:30 +0800 Subject: [PATCH 6/7] remove warning code --- src/ui/page_scannow.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/page_scannow.c b/src/ui/page_scannow.c index 7ab77950..0c460694 100644 --- a/src/ui/page_scannow.c +++ b/src/ui/page_scannow.c @@ -235,7 +235,6 @@ static lv_obj_t *page_scannow_create(lv_obj_t *parent, panel_arr_t *arr) { LV_GRID_ALIGN_CENTER, 0, 1); lv_obj_t *label2 = lv_label_create(cont1); - snprintf(setting_key, sizeof(setting_key), "element_%s_pos_16_9_x", config_name); snprintf(buf, sizeof(buf), "%s\n %s\n %s", _lang("When scanning is complete, use the"), _lang("dial to select a channel and press"), From bd084c318abd0b0b8f162a5649293375d8ce9970 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:07:54 +0800 Subject: [PATCH 7/7] update TRANSLATE_STRING_NUM --- src/lang/language.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lang/language.h b/src/lang/language.h index b6c250ab..54ba5e4f 100644 --- a/src/lang/language.h +++ b/src/lang/language.h @@ -3,8 +3,8 @@ #include "core/settings.h" -#define TRANSLATE_STRING_NUM 268 -#define LANG_FOLDER "/mnt/app/language" +#define TRANSLATE_STRING_NUM 278 +#define LANG_FOLDER "/mnt/app/language" typedef enum { LANG_ENGLISH_DEFAULT = 0, @@ -22,7 +22,7 @@ const char *translate_string(const char *str, lang_e lang); bool language_config(); #define _str(string, lang) translate_string(string, lang) -#define _(string) _str(string, g_setting.language.lang) -#define _lang(string) _((string)) +#define _(string) _str(string, g_setting.language.lang) +#define _lang(string) _((string)) #endif \ No newline at end of file