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

Fix Chinese translation #474

Merged
merged 7 commits into from
Jan 22, 2025
Merged
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
28 changes: 19 additions & 9 deletions mkapp/app/language/zh_hans.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "扫频就绪"
Expand All @@ -31,16 +33,17 @@ HDZero BW = "HDZero带宽"
Wide = "宽带"
Narrow = "窄带"
Back = "返回"
Detected = "00FF00 已连接"
Disconnected = "C0C0C0 未连接"
Connected = "已连接"
Disconnected = "未连接"

; 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已经运行"
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 = "分钟"

Expand All @@ -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 = "电源"
Expand Down Expand Up @@ -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 = "自动扫频"
Expand Down Expand Up @@ -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 = "没有找到"
Expand All @@ -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 = "眼镜"

Expand Down
8 changes: 4 additions & 4 deletions src/lang/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
5 changes: 4 additions & 1 deletion src/ui/page_imagesettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion src/ui/page_osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion src/ui/page_record.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "page_record.h"

#include <stdio.h>
#include <stdlib.h>

#include <minIni.h>
Expand Down Expand Up @@ -83,7 +84,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."));
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);
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);
Expand Down
8 changes: 7 additions & 1 deletion src/ui/page_scannow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -233,7 +235,11 @@ 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(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);
Expand Down
14 changes: 11 additions & 3 deletions src/ui/page_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"));
Expand Down
Loading