diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c index ac9e835b..e8396340 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c @@ -951,12 +951,12 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) menu_fini (); if (g_ventoy_terminal_output == 0) { - grub_script_execute_sourcecode("terminal_output console"); + grub_script_execute_sourcecode("vt_push_menu_lang en_US\nterminal_output console"); g_ventoy_terminal_output = 1; } else { - grub_script_execute_sourcecode("terminal_output gfxterm"); + grub_script_execute_sourcecode("terminal_output gfxterm\nvt_pop_menu_lang"); g_ventoy_terminal_output = 0; } goto refresh; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c index 7b572794..234a509b 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c @@ -6951,6 +6951,8 @@ static cmd_para ventoy_cmds[] = { "vt_cur_menu_lang", ventoy_cmd_cur_menu_lang, 0, NULL, "", "", NULL }, { "vt_vtoychksum_exist", ventoy_cmd_vtoychksum_exist, 0, NULL, "", "", NULL }, { "vt_cmp_checksum", ventoy_cmd_cmp_checksum, 0, NULL, "", "", NULL }, + { "vt_push_menu_lang", ventoy_cmd_push_menulang, 0, NULL, "", "", NULL }, + { "vt_pop_menu_lang", ventoy_cmd_pop_menulang, 0, NULL, "", "", NULL }, }; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h index df424323..1fc32303 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h @@ -1313,6 +1313,8 @@ grub_err_t ventoy_cmd_cur_menu_lang(grub_extcmd_context_t ctxt, int argc, char * extern int ventoy_menu_push_key(int code); int ventoy_ctrl_var_init(void); int ventoy_global_var_init(void); +grub_err_t ventoy_cmd_push_menulang(grub_extcmd_context_t ctxt, int argc, char **args); +grub_err_t ventoy_cmd_pop_menulang(grub_extcmd_context_t ctxt, int argc, char **args); #endif /* __VENTOY_DEF_H__ */ diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c index b5acba2f..8a95b33b 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c @@ -66,6 +66,7 @@ static theme_list *g_theme_head = NULL; static int g_theme_random = vtoy_theme_random_boot_second; static char g_theme_single_file[256]; static char g_cur_menu_language[32] = {0}; +static char g_push_menu_language[32] = {0}; static int ventoy_plugin_is_parent(const char *pat, int patlen, const char *isopath) { @@ -3624,3 +3625,33 @@ grub_err_t ventoy_cmd_cur_menu_lang(grub_extcmd_context_t ctxt, int argc, char * VENTOY_CMD_RETURN(0); } +grub_err_t ventoy_cmd_push_menulang(grub_extcmd_context_t ctxt, int argc, char **args) +{ + (void)argc; + (void)ctxt; + + if (g_push_menu_language[0] == 0) + { + grub_memcpy(g_push_menu_language, g_cur_menu_language, sizeof(g_push_menu_language)); + ventoy_plugin_load_menu_lang(0, args[0]); + } + + VENTOY_CMD_RETURN(0); +} + +grub_err_t ventoy_cmd_pop_menulang(grub_extcmd_context_t ctxt, int argc, char **args) +{ + (void)argc; + (void)ctxt; + (void)args; + + if (g_push_menu_language[0]) + { + ventoy_plugin_load_menu_lang(0, g_push_menu_language); + g_push_menu_language[0] = 0; + } + + VENTOY_CMD_RETURN(0); +} + + diff --git a/INSTALL/grub/debug.cfg b/INSTALL/grub/debug.cfg index 94394968..a7d5cc2a 100644 --- a/INSTALL/grub/debug.cfg +++ b/INSTALL/grub/debug.cfg @@ -83,10 +83,12 @@ submenu "$VTLANG_RESOLUTION_CFG" --class=debug_resolution --class=F5tool { submenu "$VTLANG_SCREEN_MODE" --class=debug_screen_mode --class=F5tool { menuentry "$VTLANG_SCREEN_TEXT_MODE" --class=debug_text_mode --class=debug_screen_mode --class=F5tool { + vt_push_menu_lang en_US terminal_output console } menuentry "$VTLANG_SCREEN_GUI_MODE" --class=debug_gui_mode --class=debug_screen_mode --class=F5tool { terminal_output gfxterm + vt_pop_menu_lang } menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET { echo "Return ..."