Multi-language support (#15453)
This commit is contained in:
committed by
Scott Lahteine
parent
dc14d4a13c
commit
6a865a6146
@ -168,7 +168,7 @@ int8_t g26_prime_flag;
|
||||
*/
|
||||
bool user_canceled() {
|
||||
if (!ui.button_pressed()) return false; // Return if the button isn't pressed
|
||||
ui.set_status_P(PSTR(MSG_G26_CANCELED), 99);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_CANCELED), 99);
|
||||
#if HAS_LCD_MENU
|
||||
ui.quick_feedback();
|
||||
#endif
|
||||
@ -370,7 +370,7 @@ inline bool turn_on_heaters() {
|
||||
|
||||
if (g26_bed_temp > 25) {
|
||||
#if HAS_SPI_LCD
|
||||
ui.set_status_P(PSTR(MSG_G26_HEATING_BED), 99);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_HEATING_BED), 99);
|
||||
ui.quick_feedback();
|
||||
#if HAS_LCD_MENU
|
||||
ui.capture();
|
||||
@ -391,7 +391,7 @@ inline bool turn_on_heaters() {
|
||||
|
||||
// Start heating the active nozzle
|
||||
#if HAS_SPI_LCD
|
||||
ui.set_status_P(PSTR(MSG_G26_HEATING_NOZZLE), 99);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_HEATING_NOZZLE), 99);
|
||||
ui.quick_feedback();
|
||||
#endif
|
||||
thermalManager.setTargetHotend(g26_hotend_temp, active_extruder);
|
||||
@ -426,7 +426,7 @@ inline bool prime_nozzle() {
|
||||
if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged
|
||||
|
||||
ui.capture();
|
||||
ui.set_status_P(PSTR(MSG_G26_MANUAL_PRIME), 99);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_MANUAL_PRIME), 99);
|
||||
ui.chirp();
|
||||
|
||||
destination = current_position;
|
||||
@ -450,7 +450,7 @@ inline bool prime_nozzle() {
|
||||
|
||||
ui.wait_for_release();
|
||||
|
||||
ui.set_status_P(PSTR(MSG_G26_PRIME_DONE), 99);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_PRIME_DONE), 99);
|
||||
ui.quick_feedback();
|
||||
ui.release();
|
||||
}
|
||||
@ -458,7 +458,7 @@ inline bool prime_nozzle() {
|
||||
#endif
|
||||
{
|
||||
#if HAS_SPI_LCD
|
||||
ui.set_status_P(PSTR(MSG_G26_FIXED_LENGTH), 99);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_FIXED_LENGTH), 99);
|
||||
ui.quick_feedback();
|
||||
#endif
|
||||
destination = current_position;
|
||||
@ -827,7 +827,7 @@ void GcodeSuite::G26() {
|
||||
} while (--g26_repeats && location.valid());
|
||||
|
||||
LEAVE:
|
||||
ui.set_status_P(PSTR(MSG_G26_LEAVING), -1);
|
||||
ui.set_status_P(GET_TEXT(MSG_G26_LEAVING), -1);
|
||||
|
||||
retract_filament(destination);
|
||||
destination.z = Z_CLEARANCE_BETWEEN_PROBES;
|
||||
|
@ -722,7 +722,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), ".");
|
||||
#if HAS_DISPLAY
|
||||
ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), PSTR(MSG_PROBING_MESH), int(pt_index), int(GRID_MAX_POINTS));
|
||||
ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), int(pt_index), int(GRID_MAX_POINTS));
|
||||
#endif
|
||||
|
||||
measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(probePos, raise_after, verbose_level);
|
||||
@ -764,7 +764,7 @@ G29_TYPE GcodeSuite::G29() {
|
||||
for (uint8_t i = 0; i < 3; ++i) {
|
||||
if (verbose_level) SERIAL_ECHOLNPAIR("Probing point ", int(i), "/3.");
|
||||
#if HAS_DISPLAY
|
||||
ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/3"), int(i));
|
||||
ui.status_printf_P(0, PSTR(S_FMT" %i/3"), GET_TEXT(MSG_PROBING_MESH)), int(i);
|
||||
#endif
|
||||
|
||||
// Retain the last probe position
|
||||
|
@ -118,7 +118,7 @@
|
||||
// Disallow Z homing if X or Y are unknown
|
||||
if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) {
|
||||
LCD_MESSAGEPGM(MSG_ERR_Z_HOMING);
|
||||
SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING);
|
||||
SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING_SER);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
}
|
||||
else {
|
||||
LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
|
||||
SERIAL_ECHO_MSG(MSG_ZPROBE_OUT);
|
||||
SERIAL_ECHO_MSG(MSG_ZPROBE_OUT_SER);
|
||||
}
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< home_z_safely");
|
||||
|
@ -126,7 +126,7 @@ void GcodeSuite::M48() {
|
||||
for (uint8_t n = 0; n < n_samples; n++) {
|
||||
#if HAS_SPI_LCD
|
||||
// Display M48 progress in the status bar
|
||||
ui.status_printf_P(0, PSTR(MSG_M48_POINT ": %d/%d"), int(n + 1), int(n_samples));
|
||||
ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
|
||||
#endif
|
||||
if (n_legs) {
|
||||
const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise
|
||||
@ -252,7 +252,7 @@ void GcodeSuite::M48() {
|
||||
#if HAS_SPI_LCD
|
||||
// Display M48 results in the status bar
|
||||
char sigma_str[8];
|
||||
ui.status_printf_P(0, PSTR(MSG_M48_DEVIATION ": %s"), dtostrf(sigma, 2, 6, sigma_str));
|
||||
ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -93,13 +93,13 @@ void GcodeSuite::M852() {
|
||||
|
||||
if (!ijk) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR_F(MSG_SKEW_FACTOR " XY: ", planner.skew_factor.xy, 6);
|
||||
serialprintPGM(GET_TEXT(MSG_SKEW_FACTOR));
|
||||
SERIAL_ECHOPAIR_F(" XY: ", planner.skew_factor.xy, 6);
|
||||
#if ENABLED(SKEW_CORRECTION_FOR_Z)
|
||||
SERIAL_ECHOPAIR(" XZ: ", planner.skew_factor.xz);
|
||||
SERIAL_ECHOLNPAIR(" YZ: ", planner.skew_factor.yz);
|
||||
#else
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHOPAIR_F(" XZ: ", planner.skew_factor.xz, 6);
|
||||
SERIAL_ECHOPAIR_F(" YZ: ", planner.skew_factor.yz, 6);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,7 +334,7 @@ void GcodeSuite::M43() {
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(PSTR("M43 Wait Called"));
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("M43 Wait Called"));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -41,7 +41,7 @@ void GcodeSuite::M108() {
|
||||
* M112: Full Shutdown
|
||||
*/
|
||||
void GcodeSuite::M112() {
|
||||
kill(PSTR("M112 Shutdown"), true);
|
||||
kill(PSTR("M112 Shutdown"), nullptr, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,6 +110,6 @@ void GcodeSuite::M81() {
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF ".");
|
||||
LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " MSG_OFF "."));
|
||||
#endif
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ void GcodeSuite::M428() {
|
||||
diff[i] = -current_position[i];
|
||||
if (!WITHIN(diff[i], -20, 20)) {
|
||||
SERIAL_ERROR_MSG(MSG_ERR_M428_TOO_FAR);
|
||||
LCD_ALERTMESSAGEPGM("Err: Too far!");
|
||||
LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!"));
|
||||
BUZZ(200, 40);
|
||||
return;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
void GcodeSuite::M16() {
|
||||
|
||||
if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME)))
|
||||
kill(PSTR(MSG_EXPECTED_PRINTER));
|
||||
kill(GET_TEXT(MSG_EXPECTED_PRINTER));
|
||||
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,10 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
|
||||
ExtUI::onUserConfirmRequired(has_message ? args : MSG_USERWAIT); // SRAM string
|
||||
if (has_message)
|
||||
ExtUI::onUserConfirmRequired(args); // Can this take an SRAM string??
|
||||
else
|
||||
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
|
||||
|
||||
#else
|
||||
|
||||
@ -98,7 +101,7 @@ void GcodeSuite::M0_M1() {
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired(PSTR("M0/1 Break Called"));
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("M0/1 Break Called"));
|
||||
#endif
|
||||
|
||||
if (ms > 0) {
|
||||
|
@ -64,7 +64,7 @@ void GcodeSuite::M190() {
|
||||
}
|
||||
else return;
|
||||
|
||||
ui.set_status_P(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING));
|
||||
ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));
|
||||
|
||||
thermalManager.wait_for_bed(no_wait_for_cooling);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ void GcodeSuite::M191() {
|
||||
}
|
||||
else return;
|
||||
|
||||
lcd_setstatusPGM(thermalManager.isHeatingChamber() ? PSTR(MSG_CHAMBER_HEATING) : PSTR(MSG_CHAMBER_COOLING));
|
||||
lcd_setstatusPGM(thermalManager.isHeatingChamber() ? GET_TEXT(MSG_CHAMBER_HEATING) : GET_TEXT(MSG_CHAMBER_COOLING));
|
||||
|
||||
thermalManager.wait_for_chamber(no_wait_for_cooling);
|
||||
}
|
||||
|
Reference in New Issue
Block a user