From daf75665c798cfe56171cea271abec8010d96ecc Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:16:34 +0800 Subject: [PATCH] do not repower if language doesn't changed. --- src/lang/simplified_chinese.c | 2 +- src/ui/page_version.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lang/simplified_chinese.c b/src/lang/simplified_chinese.c index 6306ba4c..62d5c6fb 100644 --- a/src/lang/simplified_chinese.c +++ b/src/lang/simplified_chinese.c @@ -252,7 +252,7 @@ translate_t translate_simplified_chinese[TRANSLATE_STRING_NUM] = { {"English", "英语"}, {"Simplified Chinese", "简体中文"}, {"Set Language", "设置语言"}, - {"Language has been changed.\nPlease repower goggle now.", "语言已修改.\n现在请重启眼镜"}, + {"Language has been changed.\nPlease repower goggle now.", "语言已修改.\n现在请重启眼镜."}, {"Goggle", "眼镜"}, // focus chart diff --git a/src/ui/page_version.c b/src/ui/page_version.c index 61175e80..4deb9188 100644 --- a/src/ui/page_version.c +++ b/src/ui/page_version.c @@ -1036,9 +1036,11 @@ static void page_version_on_click(uint8_t key, int sel) { dropdown_lang_is_opened = false; pp_version.p_arr.max = ROW_COUNT; // enable roller operation on input_device.c uint16_t selected = lv_dropdown_get_selected(dropdown_lang); - ini_putl("language", "lang", selected, SETTING_INI); - lv_obj_clear_flag(msgbox_language_changed, LV_OBJ_FLAG_HIDDEN); - app_state_push(APP_STATE_USER_INPUT_DISABLED); + if (selected != g_setting.language.lang) { + ini_putl("language", "lang", selected, SETTING_INI); + lv_obj_clear_flag(msgbox_language_changed, LV_OBJ_FLAG_HIDDEN); + app_state_push(APP_STATE_USER_INPUT_DISABLED); + } } else { lv_dropdown_open(dropdown_lang); lv_obj_add_style(dropdown_lang, &style_dropdown, LV_PART_MAIN);