Skip to content

Translatable Strings for ubl_G29 #6990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Marlin/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,17 @@
#ifndef MSG_LEVEL_BED
#define MSG_LEVEL_BED _UxGT("Level bed")
#endif
#ifndef MSG_EDITING_STOPPED
#define MSG_EDITING_STOPPED _UxGT("Mesh Editing Stopped")
#endif
#ifndef MSG_USER_MENU
#define MSG_USER_MENU _UxGT("Custom Commands")
#endif

#if ENABLED(AUTO_BED_LEVELING_UBL)
#ifndef MSG_UBL_DOING_G29
#define MSG_UBL_DOING_G29 _UxGT("Doing G29 UBL!")
#endif
#ifndef MSG_UBL_UNHOMED
#define MSG_UBL_UNHOMED _UxGT("Home XYZ first")
#endif
Expand All @@ -173,6 +179,18 @@
#ifndef MSG_UBL_MANUAL_MESH
#define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh")
#endif
#ifndef MSG_UBL_BC_INSERT
#define MSG_UBL_BC_INSERT _UxGT("Place shim & measure")
#endif
#ifndef MSG_UBL_BC_INSERT2
#define MSG_UBL_BC_INSERT2 _UxGT("Measure")
#endif
#ifndef MSG_UBL_BC_REMOVE
#define MSG_UBL_BC_REMOVE _UxGT("Remove & measure bed")
#endif
#ifndef MSG_UBL_MOVING_TO_NEXT
#define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next")
#endif
#ifndef MSG_UBL_ACTIVATE_MESH
#define MSG_UBL_ACTIVATE_MESH _UxGT("Activate UBL")
#endif
Expand All @@ -194,6 +212,12 @@
#ifndef MSG_UBL_EDIT_CUSTOM_MESH
#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh")
#endif
#ifndef MSG_UBL_FINE_TUNE_MESH
#define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh")
#endif
#ifndef MSG_UBL_DONE_EDITING_MESH
#define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh")
#endif
#ifndef MSG_UBL_BUILD_CUSTOM_MESH
#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh")
#endif
Expand Down Expand Up @@ -299,6 +323,15 @@
#ifndef MSG_UBL_SAVE_MESH
#define MSG_UBL_SAVE_MESH _UxGT("Save Bed Mesh")
#endif
#ifndef MSG_UBL_SAVE_ERROR
#define MSG_UBL_SAVE_ERROR _UxGT("save_UBL_active() error")
#endif
#ifndef MSG_UBL_RESTORE_ERROR
#define MSG_UBL_RESTORE_ERROR _UxGT("restore_UBL_active() error")
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Shouldn't we stay below 20 characters? Only asking, because translating to german would be much easier having more space.

Copy link
Member

@thinkyhead thinkyhead Jun 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. Below 18 is even better. Below 16 ftw. Strings may also be adapted to screen width. I understand we all like to make things work with our hardware but let's think of others too.

Anyway errors like "restore_UBL_active() error" are obviously awful and obviously need replacement before merging this PR.

Copy link
Contributor Author

@Tannoo Tannoo Jun 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to help on some of the TODO's.

LCD_MESSAGEPGM("restore_UBL_active() error"); // TODO: Make translatable string

Since this was still there, I took it as being accepted.
Changing the error message is fine... I agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better?

  #ifndef MSG_UBL_SAVE_ERROR
    #define MSG_UBL_SAVE_ERROR                _UxGT("save error")
  #endif
  #ifndef MSG_UBL_RESTORE_ERROR
    #define MSG_UBL_RESTORE_ERROR             _UxGT("restore error")
  #endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a commit in a PR with "Err: UBL Save" and "Err: UBL Restore". These are internal errors that should only occur if there are bugs in the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already took "Err: UBL Save" and "Err: UBL Restore" into the german translation PR. So i'm fine with them

#ifndef MSG_UBL_Z_OFFSET_STOPPED
#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped")
#endif
#endif // AUTO_BED_LEVELING_UBL

#ifndef MSG_MOVING
Expand Down
22 changes: 11 additions & 11 deletions Marlin/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@
if (ELAPSED(millis(), nxt)) {
SERIAL_PROTOCOLLNPGM("\nZ-Offset Adjustment Stopped.");
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
LCD_MESSAGEPGM("Z-Offset Stopped"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_Z_OFFSET_STOPPED);
restore_ubl_active_state_and_leave();
goto LEAVE;
}
Expand Down Expand Up @@ -971,7 +971,7 @@
stepper.synchronize();

SERIAL_PROTOCOLPGM("Place shim under nozzle");
LCD_MESSAGEPGM("Place shim & measure"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
lcd_return_to_status();
echo_and_take_a_measurement();

Expand All @@ -980,7 +980,7 @@
stepper.synchronize();

SERIAL_PROTOCOLPGM("Remove shim");
LCD_MESSAGEPGM("Remove & measure bed"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE);
echo_and_take_a_measurement();

const float z2 = measure_point_with_encoder();
Expand Down Expand Up @@ -1029,7 +1029,7 @@

do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);

LCD_MESSAGEPGM("Moving to next"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);

do_blocking_move_to_xy(xProbe, yProbe);
do_blocking_move_to_z(z_clearance);
Expand All @@ -1039,7 +1039,7 @@

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

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

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

#if ENABLED(NEWPANEL)
LCD_MESSAGEPGM("Doing G29 UBL!"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_DOING_G29);
lcd_quick_feedback();
#endif

Expand Down Expand Up @@ -1207,7 +1207,7 @@
SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");

#if ENABLED(NEWPANEL)
LCD_MESSAGEPGM("save_UBL_active() error"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR);
lcd_quick_feedback();
#endif

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

#if ENABLED(NEWPANEL)
LCD_MESSAGEPGM("restore_UBL_active() error"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR);
lcd_quick_feedback();
#endif

Expand Down Expand Up @@ -1476,7 +1476,7 @@

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

LCD_MESSAGEPGM("Fine Tuning Mesh"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);

do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
do_blocking_move_to_xy(lx, ly);
Expand Down Expand Up @@ -1538,7 +1538,7 @@
lcd_return_to_status();
//SERIAL_PROTOCOLLNPGM("\nFine Tuning of Mesh Stopped.");
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
LCD_MESSAGEPGM("Mesh Editing Stopped"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_EDITING_STOPPED);

while (ubl_lcd_clicked()) idle();

Expand All @@ -1565,7 +1565,7 @@

do_blocking_move_to_xy(lx, ly);

LCD_MESSAGEPGM("Done Editing Mesh"); // TODO: Make translatable string
LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
SERIAL_ECHOLNPGM("Done Editing Mesh");
}
#endif
Expand Down