Multi-language support (#15453)

This commit is contained in:
Marcio Teixeira
2019-10-09 18:46:10 -06:00
committed by Scott Lahteine
parent dc14d4a13c
commit 6a865a6146
105 changed files with 11537 additions and 11196 deletions

View File

@ -757,7 +757,7 @@
const int point_num = (GRID_MAX_POINTS) - count + 1;
SERIAL_ECHOLNPAIR("\nProbing mesh point ", point_num, "/", int(GRID_MAX_POINTS), ".\n");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), point_num, int(GRID_MAX_POINTS));
ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS));
#endif
#if HAS_LCD_MENU
@ -921,7 +921,7 @@
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2));
serialprintPGM(parser.seen('B') ? GET_TEXT(MSG_UBL_BC_INSERT) : GET_TEXT(MSG_UBL_BC_INSERT2));
const float z_step = 0.01f; // existing behavior: 0.01mm per click, occasionally step
//const float z_step = planner.steps_to_mm[Z_AXIS]; // approx one step each click
@ -959,7 +959,7 @@
void abort_fine_tune() {
ui.return_to_status();
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
set_message_with_feedback(PSTR(MSG_EDITING_STOPPED));
set_message_with_feedback(GET_TEXT(MSG_EDITING_STOPPED));
}
void unified_bed_leveling::fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) {
@ -1072,7 +1072,7 @@
bool err_flag = false;
#if HAS_LCD_MENU
set_message_with_feedback(PSTR(MSG_UBL_DOING_G29));
set_message_with_feedback(GET_TEXT(MSG_UBL_DOING_G29));
#endif
g29_constant = 0;
@ -1196,7 +1196,7 @@
if (ubl_state_recursion_chk != 1) {
SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
#if HAS_LCD_MENU
set_message_with_feedback(PSTR(MSG_UBL_SAVE_ERROR));
set_message_with_feedback(GET_TEXT(MSG_UBL_SAVE_ERROR));
#endif
return;
}
@ -1210,7 +1210,7 @@
if (--ubl_state_recursion_chk) {
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
#if HAS_LCD_MENU
set_message_with_feedback(PSTR(MSG_UBL_RESTORE_ERROR));
set_message_with_feedback(GET_TEXT(MSG_UBL_RESTORE_ERROR));
#endif
return;
}
@ -1410,7 +1410,7 @@
if (do_3_pt_leveling) {
SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3"));
ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH));
#endif
measured_z = probe_at_point(points[0], PROBE_PT_RAISE, g29_verbose_level);
@ -1431,7 +1431,7 @@
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3"));
ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH));
#endif
measured_z = probe_at_point(points[1], PROBE_PT_RAISE, g29_verbose_level);
@ -1453,7 +1453,7 @@
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3"));
ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH));
#endif
measured_z = probe_at_point(points[2], PROBE_PT_STOW, g29_verbose_level);
@ -1497,7 +1497,7 @@
if (!abort_flag) {
SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n");
#if HAS_DISPLAY
ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), point_num, total_points);
ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points);
#endif
measured_z = probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling

View File

@ -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;

View File

@ -228,7 +228,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
#if PIN_EXISTS(POWER_LOSS)
void PrintJobRecovery::_outage() {
save(true);
kill(PSTR(MSG_OUTAGE_RECOVERY));
kill(GET_TEXT(MSG_OUTAGE_RECOVERY));
}
#endif

View File

@ -433,7 +433,7 @@ bool MMU2::rx_ok() {
void MMU2::check_version() {
if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required.");
kill(MSG_MMU2_WRONG_FIRMWARE);
kill(GET_TEXT(MSG_MMU2_WRONG_FIRMWARE));
}
}
@ -449,7 +449,7 @@ void MMU2::tool_change(uint8_t index) {
if (index != extruder) {
disable_E0();
ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
command(MMU_CMD_T0 + index);
@ -712,7 +712,7 @@ void MMU2::filament_runout() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired(PSTR("MMU2 Eject Recover"));
ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"));
#endif
while (wait_for_user) idle();
BUZZ(200, 404);

View File

@ -1118,7 +1118,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z
#endif
}
if (axis_connection) ui.set_status_P(PSTR(MSG_ERROR_TMC));
if (axis_connection) ui.set_status_P(GET_TEXT(MSG_ERROR_TMC));
}
#endif // HAS_TRINAMIC