Skip to content

Commit 591cd8c

Browse files
Tannoofixoid
authored andcommitted
Translatable Strings for ubl_G29 (MarlinFirmware#6990)
1 parent 182071a commit 591cd8c

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

Marlin/language_en.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,17 @@
156156
#ifndef MSG_LEVEL_BED
157157
#define MSG_LEVEL_BED _UxGT("Level bed")
158158
#endif
159+
#ifndef MSG_EDITING_STOPPED
160+
#define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped")
161+
#endif
159162
#ifndef MSG_USER_MENU
160163
#define MSG_USER_MENU _UxGT("Custom Commands")
161164
#endif
162165

163166
#if ENABLED(AUTO_BED_LEVELING_UBL)
167+
#ifndef MSG_UBL_DOING_G29
168+
#define MSG_UBL_DOING_G29 _UxGT("Doing G29 UBL!")
169+
#endif
164170
#ifndef MSG_UBL_UNHOMED
165171
#define MSG_UBL_UNHOMED _UxGT("Home XYZ first")
166172
#endif
@@ -173,6 +179,18 @@
173179
#ifndef MSG_UBL_MANUAL_MESH
174180
#define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh")
175181
#endif
182+
#ifndef MSG_UBL_BC_INSERT
183+
#define MSG_UBL_BC_INSERT _UxGT("Place shim & measure")
184+
#endif
185+
#ifndef MSG_UBL_BC_INSERT2
186+
#define MSG_UBL_BC_INSERT2 _UxGT("Measure")
187+
#endif
188+
#ifndef MSG_UBL_BC_REMOVE
189+
#define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed")
190+
#endif
191+
#ifndef MSG_UBL_MOVING_TO_NEXT
192+
#define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next")
193+
#endif
176194
#ifndef MSG_UBL_ACTIVATE_MESH
177195
#define MSG_UBL_ACTIVATE_MESH _UxGT("Activate UBL")
178196
#endif
@@ -194,6 +212,12 @@
194212
#ifndef MSG_UBL_EDIT_CUSTOM_MESH
195213
#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh")
196214
#endif
215+
#ifndef MSG_UBL_FINE_TUNE_MESH
216+
#define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh")
217+
#endif
218+
#ifndef MSG_UBL_DONE_EDITING_MESH
219+
#define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh")
220+
#endif
197221
#ifndef MSG_UBL_BUILD_CUSTOM_MESH
198222
#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh")
199223
#endif
@@ -299,6 +323,15 @@
299323
#ifndef MSG_UBL_SAVE_MESH
300324
#define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh")
301325
#endif
326+
#ifndef MSG_UBL_SAVE_ERROR
327+
#define MSG_UBL_SAVE_ERROR _UxGT("save_UBL_active() error")
328+
#endif
329+
#ifndef MSG_UBL_RESTORE_ERROR
330+
#define MSG_UBL_RESTORE_ERROR _UxGT("restore_UBL_active() error")
331+
#endif
332+
#ifndef MSG_UBL_Z_OFFSET_STOPPED
333+
#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped")
334+
#endif
302335
#endif // AUTO_BED_LEVELING_UBL
303336

304337
#ifndef MSG_MOVING

Marlin/ubl_G29.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@
713713
if (ELAPSED(millis(), nxt)) {
714714
SERIAL_PROTOCOLLNPGM("\nZ-Offset Adjustment Stopped.");
715715
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
716-
LCD_MESSAGEPGM("Z-Offset Stopped"); // TODO: Make translatable string
716+
LCD_MESSAGEPGM(MSG_UBL_Z_OFFSET_STOPPED);
717717
restore_ubl_active_state_and_leave();
718718
goto LEAVE;
719719
}
@@ -971,7 +971,7 @@
971971
stepper.synchronize();
972972

973973
SERIAL_PROTOCOLPGM("Place shim under nozzle");
974-
LCD_MESSAGEPGM("Place shim & measure"); // TODO: Make translatable string
974+
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
975975
lcd_return_to_status();
976976
echo_and_take_a_measurement();
977977

@@ -980,7 +980,7 @@
980980
stepper.synchronize();
981981

982982
SERIAL_PROTOCOLPGM("Remove shim");
983-
LCD_MESSAGEPGM("Remove & measure bed"); // TODO: Make translatable string
983+
LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE);
984984
echo_and_take_a_measurement();
985985

986986
const float z2 = measure_point_with_encoder();
@@ -1029,7 +1029,7 @@
10291029

10301030
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
10311031

1032-
LCD_MESSAGEPGM("Moving to next"); // TODO: Make translatable string
1032+
LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
10331033

10341034
do_blocking_move_to_xy(xProbe, yProbe);
10351035
do_blocking_move_to_z(z_clearance);
@@ -1039,7 +1039,7 @@
10391039

10401040
if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing
10411041

1042-
serialprintPGM(parser.seen('B') ? PSTR("Place shim & measure") : PSTR("Measure")); // TODO: Make translatable strings
1042+
serialprintPGM(parser.seen('B') ? PSTR(MSG_UBL_BC_INSERT) : PSTR(MSG_UBL_BC_INSERT2));
10431043

10441044
const float z_step = 0.01; // existing behavior: 0.01mm per click, occasionally step
10451045
//const float z_step = 1.0 / planner.axis_steps_per_mm[Z_AXIS]; // approx one step each click
@@ -1097,7 +1097,7 @@
10971097
bool err_flag = false;
10981098

10991099
#if ENABLED(NEWPANEL)
1100-
LCD_MESSAGEPGM("Doing G29 UBL!"); // TODO: Make translatable string
1100+
LCD_MESSAGEPGM(MSG_UBL_DOING_G29);
11011101
lcd_quick_feedback();
11021102
#endif
11031103

@@ -1207,7 +1207,7 @@
12071207
SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
12081208

12091209
#if ENABLED(NEWPANEL)
1210-
LCD_MESSAGEPGM("save_UBL_active() error"); // TODO: Make translatable string
1210+
LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR);
12111211
lcd_quick_feedback();
12121212
#endif
12131213

@@ -1222,7 +1222,7 @@
12221222
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
12231223

12241224
#if ENABLED(NEWPANEL)
1225-
LCD_MESSAGEPGM("restore_UBL_active() error"); // TODO: Make translatable string
1225+
LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR);
12261226
lcd_quick_feedback();
12271227
#endif
12281228

@@ -1476,7 +1476,7 @@
14761476

14771477
memset(not_done, 0xFF, sizeof(not_done));
14781478

1479-
LCD_MESSAGEPGM("Fine Tuning Mesh"); // TODO: Make translatable string
1479+
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
14801480

14811481
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
14821482
do_blocking_move_to_xy(lx, ly);
@@ -1538,7 +1538,7 @@
15381538
lcd_return_to_status();
15391539
//SERIAL_PROTOCOLLNPGM("\nFine Tuning of Mesh Stopped.");
15401540
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
1541-
LCD_MESSAGEPGM("Mesh Editing Stopped"); // TODO: Make translatable string
1541+
LCD_MESSAGEPGM(MSG_EDITING_STOPPED);
15421542

15431543
while (ubl_lcd_clicked()) idle();
15441544

@@ -1565,7 +1565,7 @@
15651565

15661566
do_blocking_move_to_xy(lx, ly);
15671567

1568-
LCD_MESSAGEPGM("Done Editing Mesh"); // TODO: Make translatable string
1568+
LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
15691569
SERIAL_ECHOLNPGM("Done Editing Mesh");
15701570
}
15711571
#endif

0 commit comments

Comments
 (0)