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;
{ "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 },
};
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__ */
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)
{
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);
+}
+
+
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 ..."