From 068c303742dc9df785bce68eda858dc72bd6e55c Mon Sep 17 00:00:00 2001
From: Ludy <Ludy87@users.noreply.github.com>
Date: Sun, 8 Sep 2019 07:15:25 +0200
Subject: [PATCH] More translatable LCD strings (#15190)

---
 Marlin/src/feature/tmc_util.cpp               |  2 +-
 Marlin/src/gcode/bedlevel/G26.cpp             | 14 +++---
 .../extensible_ui/lib/dgus/DGUSDisplay.cpp    |  4 +-
 Marlin/src/lcd/language/language_de.h         | 22 +++++++--
 Marlin/src/lcd/language/language_en.h         | 45 +++++++++++++++++++
 Marlin/src/lcd/menu/menu_ubl.cpp              |  4 +-
 .../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp  | 10 ++---
 7 files changed, 80 insertions(+), 21 deletions(-)

diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp
index 428a5986fad..329c511ecde 100644
--- a/Marlin/src/feature/tmc_util.cpp
+++ b/Marlin/src/feature/tmc_util.cpp
@@ -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("TMC CONNECTION ERROR"));
+  if (axis_connection) ui.set_status_P(PSTR(MSG_ERROR_TMC));
 }
 
 #endif // HAS_TRINAMIC
diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp
index 3b44a293016..2d0861ad002 100644
--- a/Marlin/src/gcode/bedlevel/G26.cpp
+++ b/Marlin/src/gcode/bedlevel/G26.cpp
@@ -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("Mesh Validation Stopped."), 99);
+    ui.set_status_P(PSTR(MSG_G26_CANCELED), 99);
     #if HAS_LCD_MENU
       ui.quick_feedback();
     #endif
@@ -386,7 +386,7 @@ inline bool turn_on_heaters() {
 
     if (g26_bed_temp > 25) {
       #if HAS_SPI_LCD
-        ui.set_status_P(PSTR("G26 Heating Bed."), 99);
+        ui.set_status_P(PSTR(MSG_G26_HEATING_BED), 99);
         ui.quick_feedback();
         #if HAS_LCD_MENU
           ui.capture();
@@ -407,7 +407,7 @@ inline bool turn_on_heaters() {
 
   // Start heating the active nozzle
   #if HAS_SPI_LCD
-    ui.set_status_P(PSTR("G26 Heating Nozzle."), 99);
+    ui.set_status_P(PSTR(MSG_G26_HEATING_NOZZLE), 99);
     ui.quick_feedback();
   #endif
   thermalManager.setTargetHotend(g26_hotend_temp, active_extruder);
@@ -441,7 +441,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("User-Controlled Prime"), 99);
+      ui.set_status_P(PSTR(MSG_G26_MANUAL_PRIME), 99);
       ui.chirp();
 
       set_destination_from_current();
@@ -465,7 +465,7 @@ inline bool prime_nozzle() {
 
       ui.wait_for_release();
 
-      ui.set_status_P(PSTR("Done Priming"), 99);
+      ui.set_status_P(PSTR(MSG_G26_PRIME_DONE), 99);
       ui.quick_feedback();
       ui.release();
     }
@@ -473,7 +473,7 @@ inline bool prime_nozzle() {
   #endif
   {
     #if HAS_SPI_LCD
-      ui.set_status_P(PSTR("Fixed Length Prime."), 99);
+      ui.set_status_P(PSTR(MSG_G26_FIXED_LENGTH), 99);
       ui.quick_feedback();
     #endif
     set_destination_from_current();
@@ -852,7 +852,7 @@ void GcodeSuite::G26() {
   } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0);
 
   LEAVE:
-  ui.set_status_P(PSTR("Leaving G26"), -1);
+  ui.set_status_P(PSTR(MSG_G26_LEAVING), -1);
 
   retract_filament(destination);
   destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
diff --git a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp
index 60a534a307c..53c9eeb86dc 100644
--- a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp
+++ b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp
@@ -289,11 +289,11 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable
 
     // Don't let the user in the dark why there is no reaction.
     if (!ExtUI::isMediaInserted()) {
-       setstatusmessagePGM(PSTR("No SD Card"));
+       setstatusmessagePGM(PSTR(MSG_NO_MEDIA));
        return;
     }
     if (card.flag.abort_sd_printing) {
-       setstatusmessagePGM(PSTR("Aborting..."));
+       setstatusmessagePGM(PSTR(MSG_MEDIA_ABORTING));
        return;
     }
   }
diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h
index 9be26d34aec..2172e95b1d2 100644
--- a/Marlin/src/lcd/language/language_de.h
+++ b/Marlin/src/lcd/language/language_de.h
@@ -37,9 +37,14 @@
 #define MSG_YES                             _UxGT("JA")
 #define MSG_NO                              _UxGT("NEIN")
 #define MSG_BACK                            _UxGT("Zurück")
+#define MSG_MEDIA_ABORTING                  _UxGT("Abbruch...")
 #define MSG_MEDIA_INSERTED                  _UxGT("Medium erkannt")
 #define MSG_MEDIA_REMOVED                   _UxGT("Medium entfernt")
-#define MSG_MEDIA_RELEASED                  _UxGT("Medium freigeg.")
+#define MSG_MEDIA_RELEASED                  _UxGT("Medium freigegeben")
+#define MSG_MEDIA_WAITING                   _UxGT("Warten auf Medium")
+#define MSG_MEDIA_READ_ERROR                _UxGT("Medium Lesefehler")
+#define MSG_MEDIA_USB_REMOVED               _UxGT("USB Gerät entfernt")
+#define MSG_MEDIA_USB_FAILED                _UxGT("USB Start fehlge.")
 #define MSG_LCD_ENDSTOPS                    _UxGT("Endstopp") // Max length 8 characters
 #define MSG_LCD_SOFT_ENDSTOPS               _UxGT("Software-Endstopp")
 #define MSG_MAIN                            _UxGT("Hauptmenü")
@@ -94,6 +99,7 @@
 #define MSG_LEVEL_BED                       _UxGT("Bett nivellieren")
 #define MSG_LEVEL_CORNERS                   _UxGT("Ecken nivellieren")
 #define MSG_NEXT_CORNER                     _UxGT("Nächste Ecke")
+#define MSG_MESH_EDITOR                     _UxGT("Netz Editor")
 #define MSG_EDIT_MESH                       _UxGT("Netz bearbeiten")
 #define MSG_EDITING_STOPPED                 _UxGT("Netzbearb. angeh.")
 #define MSG_PROBING_MESH                    _UxGT("Messpunkt")
@@ -144,6 +150,12 @@
 #define MSG_UBL_VALIDATE_MESH_M1            _UxGT(PREHEAT_1_LABEL " Netz validieren")
 #define MSG_UBL_VALIDATE_MESH_M2            _UxGT(PREHEAT_2_LABEL " Netz validieren")
 #define MSG_UBL_VALIDATE_CUSTOM_MESH        _UxGT("Eig. Netz validieren")
+#define MSG_G26_HEATING_NOZZLE              _UxGT("G26 Heating Nozzle")
+#define MSG_G26_HEATING_BED                 _UxGT("G26 heizt Bett")
+#define MSG_G26_FIXED_LENGTH                _UxGT("Feste Länge Prime")
+#define MSG_G26_PRIME_DONE                  _UxGT("Priming fertig")
+#define MSG_G26_CANCELED                    _UxGT("G26 abgebrochen")
+#define MSG_G26_LEAVING                     _UxGT("G26 verlassen")
 #define MSG_UBL_CONTINUE_MESH               _UxGT("Netzerst. forts.")
 #define MSG_UBL_MESH_LEVELING               _UxGT("Netz-Nivellierung")
 #define MSG_UBL_3POINT_MESH_LEVELING        _UxGT("3-Punkt-Nivell.")
@@ -173,6 +185,7 @@
 #define MSG_UBL_NO_STORAGE                  _UxGT("Kein Speicher")
 #define MSG_UBL_SAVE_ERROR                  _UxGT("Err:UBL speichern")
 #define MSG_UBL_RESTORE_ERROR               _UxGT("Err:UBL wiederherst.")
+#define MSG_UBL_Z_OFFSET                    _UxGT("Z-Versatz: ")
 #define MSG_UBL_Z_OFFSET_STOPPED            _UxGT("Z-Versatz angehalten")
 #define MSG_UBL_STEP_BY_STEP_MENU           _UxGT("Schrittweises UBL")
 
@@ -296,7 +309,7 @@
 #define MSG_STOP_PRINT                      _UxGT("SD-Druck abbrechen")
 #define MSG_OUTAGE_RECOVERY                 _UxGT("Wiederh. n. Stroma.")
 #define MSG_MEDIA_MENU                      _UxGT("Druck vom Medium")
-#define MSG_NO_MEDIA                        _UxGT("Keine Medium")
+#define MSG_NO_MEDIA                        _UxGT("Kein Medium")
 #define MSG_DWELL                           _UxGT("Warten...")
 #define MSG_USERWAIT                        _UxGT("Klick zum Fortsetzen")
 #define MSG_PRINT_PAUSED                    _UxGT("Druck pausiert...")
@@ -377,8 +390,8 @@
 #define MSG_SHORT_DAY                       _UxGT("t") // One character only
 #define MSG_SHORT_HOUR                      _UxGT("h") // One character only
 #define MSG_SHORT_MINUTE                    _UxGT("m") // One character only
-#define MSG_HEATING                         _UxGT("Extr. heizt...")
-#define MSG_COOLING                         _UxGT("Extr. kühlt...")
+#define MSG_HEATING                         _UxGT("heizt...")
+#define MSG_COOLING                         _UxGT("kühlt...")
 #define MSG_BED_HEATING                     _UxGT("Bett heizt...")
 #define MSG_BED_COOLING                     _UxGT("Bett kühlt...")
 #define MSG_CHAMBER_HEATING                 _UxGT("Gehäuse heizt...")
@@ -432,6 +445,7 @@
 #define MSG_INFO_PSU                        _UxGT("Netzteil")
 #define MSG_DRIVE_STRENGTH                  _UxGT("Motorleistung")
 #define MSG_DAC_PERCENT                     _UxGT("Treiber %")
+#define MSG_ERROR_TMC                       _UxGT("TMC Verbindungsfehler")
 #define MSG_DAC_EEPROM_WRITE                _UxGT("Werte speichern")
 #define MSG_FILAMENT_CHANGE_HEADER_PAUSE    _UxGT("DRUCK PAUSIERT")
 #define MSG_FILAMENT_CHANGE_HEADER_LOAD     _UxGT("FILAMENT LADEN")
diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h
index fc9b9c33d37..5d8092a32bb 100644
--- a/Marlin/src/lcd/language/language_en.h
+++ b/Marlin/src/lcd/language/language_en.h
@@ -61,6 +61,9 @@
 #ifndef MSG_BACK
   #define MSG_BACK                            _UxGT("Back")
 #endif
+#ifndef MSG_MEDIA_ABORTING
+  #define MSG_MEDIA_ABORTING                  _UxGT("Aborting...")
+#endif
 #ifndef MSG_MEDIA_INSERTED
   #define MSG_MEDIA_INSERTED                  _UxGT("Media Inserted")
 #endif
@@ -70,6 +73,18 @@
 #ifndef MSG_MEDIA_RELEASED
   #define MSG_MEDIA_RELEASED                  _UxGT("Media Released")
 #endif
+#ifndef MSG_MEDIA_WAITING
+  #define MSG_MEDIA_WAITING                   _UxGT("Waiting for media")
+#endif
+#ifndef MSG_MEDIA_READ_ERROR
+  #define MSG_MEDIA_READ_ERROR                _UxGT("Media read error")
+#endif
+#ifndef MSG_MEDIA_USB_REMOVED
+  #define MSG_MEDIA_USB_REMOVED               _UxGT("USB device removed")
+#endif
+#ifndef MSG_MEDIA_USB_FAILED
+  #define MSG_MEDIA_USB_FAILED                _UxGT("USB start failed")
+#endif
 #ifndef MSG_LCD_ENDSTOPS
   #define MSG_LCD_ENDSTOPS                    _UxGT("Endstops") // Max length 8 characters
 #endif
@@ -232,6 +247,9 @@
 #ifndef MSG_NEXT_CORNER
   #define MSG_NEXT_CORNER                     _UxGT("Next Corner")
 #endif
+#ifndef MSG_MESH_EDITOR
+  #define MSG_MESH_EDITOR                     _UxGT("Mesh Editor")
+#endif
 #ifndef MSG_EDIT_MESH
   #define MSG_EDIT_MESH                       _UxGT("Edit Mesh")
 #endif
@@ -382,6 +400,27 @@
 #ifndef MSG_UBL_VALIDATE_CUSTOM_MESH
   #define MSG_UBL_VALIDATE_CUSTOM_MESH        _UxGT("Validate Custom Mesh")
 #endif
+#ifndef MSG_G26_HEATING_BED
+  #define MSG_G26_HEATING_BED                 _UxGT("G26 Heating Bed")
+#endif
+#ifndef MSG_G26_HEATING_NOZZLE
+  #define MSG_G26_HEATING_NOZZLE              _UxGT("G26 Heating Nozzle")
+#endif
+#ifndef MSG_G26_MANUAL_PRIME
+  #define MSG_G26_MANUAL_PRIME                _UxGT("Manual priming...")
+#endif
+#ifndef MSG_G26_FIXED_LENGTH
+  #define MSG_G26_FIXED_LENGTH                _UxGT("Fixed Length Prime")
+#endif
+#ifndef MSG_G26_PRIME_DONE
+  #define MSG_G26_PRIME_DONE                  _UxGT("Done Priming")
+#endif
+#ifndef MSG_G26_CANCELED
+  #define MSG_G26_CANCELED                    _UxGT("G26 Canceled")
+#endif
+#ifndef MSG_G26_LEAVING
+  #define MSG_G26_LEAVING                     _UxGT("Leaving G26")
+#endif
 #ifndef MSG_UBL_CONTINUE_MESH
   #define MSG_UBL_CONTINUE_MESH               _UxGT("Continue Bed Mesh")
 #endif
@@ -469,6 +508,9 @@
 #ifndef MSG_UBL_RESTORE_ERROR
   #define MSG_UBL_RESTORE_ERROR               _UxGT("Err: UBL Restore")
 #endif
+#ifndef MSG_UBL_Z_OFFSET
+  #define MSG_UBL_Z_OFFSET                    _UxGT("Z-Offset: ")
+#endif
 #ifndef MSG_UBL_Z_OFFSET_STOPPED
   #define MSG_UBL_Z_OFFSET_STOPPED            _UxGT("Z-Offset Stopped")
 #endif
@@ -1217,6 +1259,9 @@
 #ifndef MSG_DAC_PERCENT
   #define MSG_DAC_PERCENT                     _UxGT("Driver %")
 #endif
+#ifndef MSG_ERROR_TMC
+  #define MSG_ERROR_TMC                       _UxGT("TMC CONNECTION ERROR")
+#endif
 #ifndef MSG_DAC_EEPROM_WRITE
   #define MSG_DAC_EEPROM_WRITE                _UxGT("DAC EEPROM Write")
 #endif
diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp
index 85e42a8b87b..a764b85bdb1 100644
--- a/Marlin/src/lcd/menu/menu_ubl.cpp
+++ b/Marlin/src/lcd/menu/menu_ubl.cpp
@@ -79,7 +79,7 @@ void _lcd_mesh_edit_NOP() {
 float lcd_mesh_edit() {
   ui.goto_screen(_lcd_mesh_edit_NOP);
   ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
-  _lcd_mesh_fine_tune(PSTR("Mesh Editor"));
+  _lcd_mesh_fine_tune(PSTR(MSG_MESH_EDITOR));
   return mesh_edit_value;
 }
 
@@ -89,7 +89,7 @@ void lcd_mesh_edit_setup(const float &initial) {
 }
 
 void _lcd_z_offset_edit() {
-  _lcd_mesh_fine_tune(PSTR("Z-Offset: "));
+  _lcd_mesh_fine_tune(PSTR(MSG_UBL_Z_OFFSET));
 }
 
 float lcd_z_offset_edit() {
diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp
index a50d874eb05..12f02c19f04 100644
--- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp
+++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp
@@ -117,7 +117,7 @@ bool Sd2Card::usbStartup() {
     if (!UHS_START) {
       SERIAL_ECHOLNPGM(" failed.");
       #if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
-        LCD_MESSAGEPGM("USB start failed");
+        LCD_MESSAGEPGM(MSG_MEDIA_USB_FAILED);
       #endif
       return false;
     }
@@ -214,7 +214,7 @@ void Sd2Card::idle() {
             SERIAL_ECHOLNPGM("Waiting for media");
           #endif
           #if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
-            LCD_MESSAGEPGM("Waiting for media");
+            LCD_MESSAGEPGM(MSG_MEDIA_WAITING);
           #endif
           GOTO_STATE_AFTER_DELAY(state, 2000);
         }
@@ -231,7 +231,7 @@ void Sd2Card::idle() {
       #endif
       #if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
         if (state != MEDIA_READY)
-          LCD_MESSAGEPGM("USB device removed");
+          LCD_MESSAGEPGM(MSG_MEDIA_USB_REMOVED);
       #endif
       GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 );
     }
@@ -242,14 +242,14 @@ void Sd2Card::idle() {
         SERIAL_ECHOLNPGM("Media removed");
       #endif
       #if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
-        LCD_MESSAGEPGM("Media removed");
+        LCD_MESSAGEPGM(MSG_MEDIA_REMOVED);
       #endif
       GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 );
     }
 
     else if (task_state == UHS_STATE(ERROR)) {
         #if EITHER(ULTRA_LCD, EXTENSIBLE_UI)
-          LCD_MESSAGEPGM("Media read error");
+          LCD_MESSAGEPGM(MSG_MEDIA_READ_ERROR);
         #endif
         GOTO_STATE_AFTER_DELAY( MEDIA_ERROR, 0 );
     }