Multi-language support (#15453)
This commit is contained in:
committed by
Scott Lahteine
parent
dc14d4a13c
commit
6a865a6146
@@ -53,6 +53,7 @@
|
||||
#include "../lcd/extensible_ui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#include "../core/language.h"
|
||||
#include "../lcd/ultralcd.h"
|
||||
|
||||
#if HAS_BUZZER
|
||||
@@ -76,6 +77,12 @@ fil_change_settings_t fc_settings[EXTRUDERS];
|
||||
#include "../sd/cardreader.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#define _PMSG(L) L##_M108
|
||||
#else
|
||||
#define _PMSG(L) L##_LCD
|
||||
#endif
|
||||
|
||||
#if HAS_BUZZER
|
||||
static void filament_change_beep(const int8_t max_beep_count, const bool init=false) {
|
||||
if (pause_mode == PAUSE_MODE_PAUSE_PRINT) return;
|
||||
@@ -163,7 +170,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
#if HAS_LCD_MENU
|
||||
if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_INSERT, mode);
|
||||
#endif
|
||||
SERIAL_ECHO_MSG(MSG_FILAMENT_CHANGE_INSERT);
|
||||
SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_INSERT));
|
||||
|
||||
#if HAS_BUZZER
|
||||
filament_change_beep(max_beep_count, true);
|
||||
@@ -188,7 +195,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
host_action_prompt_show();
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(PSTR("Load Filament"));
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Load Filament"));
|
||||
#endif
|
||||
while (wait_for_user) {
|
||||
#if HAS_BUZZER
|
||||
@@ -243,7 +250,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purge Running..."), PSTR("Continue"));
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(PSTR("Filament Purge Running..."));
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Filament Purge Running..."));
|
||||
#endif
|
||||
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
|
||||
do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
@@ -481,14 +488,6 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float
|
||||
* Used by M125 and M600
|
||||
*/
|
||||
|
||||
#if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(EMERGENCY_PARSER)
|
||||
#define _PMSG(L) L
|
||||
#elif ENABLED(EMERGENCY_PARSER)
|
||||
#define _PMSG(L) L##_M108
|
||||
#else
|
||||
#define _PMSG(L) L##_LCD
|
||||
#endif
|
||||
|
||||
void show_continue_prompt(const bool is_reload) {
|
||||
#if HAS_LCD_MENU
|
||||
lcd_pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING);
|
||||
@@ -527,7 +526,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue"));
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(PSTR("Nozzle Parked"));
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Nozzle Parked"));
|
||||
#endif
|
||||
while (wait_for_user) {
|
||||
#if HAS_BUZZER
|
||||
@@ -551,7 +550,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(PSTR("HeaterTimeout"));
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout"));
|
||||
#endif
|
||||
|
||||
// Wait for LCD click or M108
|
||||
@@ -581,7 +580,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheat Done"), PSTR("Continue"));
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired("Reheat finished.");
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Reheat finished."));
|
||||
#endif
|
||||
wait_for_user = true;
|
||||
nozzle_timed_out = false;
|
||||
|
Reference in New Issue
Block a user