Skip to content

Commit

Permalink
🎨 Axis name string interpolation, with examples (#22879)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 25, 2021
1 parent 854ce63 commit 1de265e
Show file tree
Hide file tree
Showing 26 changed files with 100 additions and 106 deletions.
16 changes: 8 additions & 8 deletions Marlin/src/lcd/e3v2/marlinui/dwin_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ uint8_t read_byte(uint8_t *byte) { return *byte; }
/**
* Add a string, applying substitutions for the following characters:
*
* $ displays the clipped C-string given by the itemString argument
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/
void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*=nullptr*/) {
wchar_t wchar;
Expand All @@ -62,17 +64,15 @@ void DWIN_String::add(uint8_t *string, const int8_t index, uint8_t *itemString/*
if (inum >= 10) { add_character('0' + (inum / 10)); inum %= 10; }
add_character('0' + inum);
}
else {
else
add(index == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED));
}
continue;
}
else if (ch == '$' && itemString) {
else if (ch == '$' && itemString)
add(itemString);
continue;
}

add_character(ch);
else if (ch == '@')
add_character(axis_codes[index]);
else
add_character(ch);
}
eol();
}
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_cz.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ namespace Language_cz {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikace");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrcadlení");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2. tryska @");

LSTR MSG_UBL_DOING_G29 = _UxGT("Provádím G29");
LSTR MSG_UBL_TOOLS = _UxGT("UBL nástroje");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_de.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ namespace Language_de {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplizieren");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Spiegelkopie");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("vollstä. Kontrolle");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2. Düse X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2. Düse Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2. Düse Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2. Düse @");
LSTR MSG_UBL_DOING_G29 = _UxGT("G29 ausführen");
LSTR MSG_UBL_TOOLS = _UxGT("UBL-Werkzeuge");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling");
Expand Down
15 changes: 6 additions & 9 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
* Substitutions are applied for the following characters when used
* in menu items that call lcd_put_u8str_ind_P with an index:
*
* $ displays an inserted C-string
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/

#define en 1234
Expand Down Expand Up @@ -72,12 +74,7 @@ namespace Language_en {
LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Progress Bar Test");
LSTR MSG_HOMING = _UxGT("Homing");
LSTR MSG_AUTO_HOME = _UxGT("Auto Home");
LSTR MSG_AUTO_HOME_X = _UxGT("Home X");
LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y");
LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z");
LSTR MSG_AUTO_HOME_I = _UxGT("Home ") LCD_STR_I;
LSTR MSG_AUTO_HOME_J = _UxGT("Home ") LCD_STR_J;
LSTR MSG_AUTO_HOME_K = _UxGT("Home ") LCD_STR_K;
LSTR MSG_AUTO_HOME_A = _UxGT("Home @");
LSTR MSG_FILAMENT_SET = _UxGT("Filament Settings");
LSTR MSG_FILAMENT_MAN = _UxGT("Filament Management");
LSTR MSG_LEVBED_FL = _UxGT("Front Left");
Expand Down Expand Up @@ -175,9 +172,8 @@ namespace Language_en {
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("Duplicate X-Gap");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2nd Nozzle @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Doing G29");
LSTR MSG_UBL_TOOLS = _UxGT("UBL Tools");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling");
Expand Down Expand Up @@ -279,7 +275,7 @@ namespace Language_en {

LSTR MSG_MOVING = _UxGT("Moving...");
LSTR MSG_FREE_XY = _UxGT("Free XY");
LSTR MSG_MOVE_X = _UxGT("Move X");
LSTR MSG_MOVE_X = _UxGT("Move X"); // Used by draw_edit_screen
LSTR MSG_MOVE_Y = _UxGT("Move Y");
LSTR MSG_MOVE_Z = _UxGT("Move Z");
LSTR MSG_MOVE_I = _UxGT("Move ") LCD_STR_I;
Expand All @@ -303,6 +299,7 @@ namespace Language_en {
LSTR MSG_MAXSPEED_Y = _UxGT("Max ") LCD_STR_B _UxGT(" Speed");
LSTR MSG_MAXSPEED_Z = _UxGT("Max ") LCD_STR_C _UxGT(" Speed");
LSTR MSG_MAXSPEED_E = _UxGT("Max ") LCD_STR_E _UxGT(" Speed");
LSTR MSG_MAXSPEED_A = _UxGT("Max @ Speed");
LSTR MSG_BED_Z = _UxGT("Bed Z");
LSTR MSG_NOZZLE = _UxGT("Nozzle");
LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ namespace Language_es {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicar");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia Reflejada");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Control Total");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2ª Fusor X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2ª Fusor Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2ª Fusor Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2ª Fusor @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Hacer G29");
LSTR MSG_UBL_TOOLS = _UxGT("Herramientas UBL");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Nivelado UBL");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ namespace Language_fr {
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copie miroir");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Contrôle complet");
LSTR MSG_OFFSETS_MENU = _UxGT("Offsets Outil");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("Buse 2 X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("Buse 2 Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("Buse 2 Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("Buse 2 @");
LSTR MSG_G26_HEATING_BED = _UxGT("G26: Chauffage du lit");
LSTR MSG_G26_HEATING_NOZZLE = _UxGT("Buse en chauffe...");
LSTR MSG_G26_MANUAL_PRIME = _UxGT("Amorce manuelle...");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ namespace Language_gl {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicación");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia Espello");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Control Total");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2º Bico X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2º Bico Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2º Bico Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2º Bico @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Executando G29");
LSTR MSG_UBL_TOOLS = _UxGT("Ferramentas UBL");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_hu.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ namespace Language_hu {
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Tükrözött másolás");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Teljes felügyelet");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("X-hézag másolása");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2. fej X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2. fej Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2. fej Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2. fej @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Szintezz! G29");
LSTR MSG_UBL_TOOLS = _UxGT("UBL eszköz");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Egységes ágy szint");
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/lcd/language/language_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
* Substitutions are applied for the following characters when used
* in menu items that call lcd_put_u8str_ind_P with an index:
*
* $ displays an inserted C-string
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/

#define DISPLAY_CHARSET_ISO10646_1
Expand Down Expand Up @@ -160,9 +162,8 @@ namespace Language_it {
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia speculare");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pieno controllo");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("X-Gap-X duplicato");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2° ugello X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2° ugello Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2° ugello Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2° ugello @");
LSTR MSG_UBL_DOING_G29 = _UxGT("G29 in corso");
LSTR MSG_UBL_TOOLS = _UxGT("Strumenti UBL");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Livel.letto unificato");
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/lcd/language/language_pl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
* Substitutions are applied for the following characters when used
* in menu items that call lcd_put_u8str_ind_P with an index:
*
* $ displays an inserted C-string
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/

#define DISPLAY_CHARSET_ISO10646_PL
Expand Down Expand Up @@ -133,9 +135,8 @@ namespace Language_pl {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplikowanie");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Kopia lustrzana");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Pełne sterowanie");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2ga dysza X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2ga dysza Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2ga dysza Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2ga dysza @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Wykonywanie G29");
LSTR MSG_UBL_TOOLS = _UxGT("Narzędzia UBL");
LSTR MSG_LCD_TILTING_MESH = _UxGT("Punkt pochylenia");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_pt_br.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ namespace Language_pt_br {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicação");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Cópia espelhada");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Controle Total");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2o bico X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2o bico Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2o bico Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2o bico @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Executando G29");
LSTR MSG_UBL_TOOLS = _UxGT("Ferramentas UBL");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Nivel. Mesa Unif.");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_ro.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ namespace Language_ro {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2nd Nozzle @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Doing G29");
LSTR MSG_UBL_TOOLS = _UxGT("UBL Tools");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Unified Bed Leveling");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_ru.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ namespace Language_ru {
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Полный контроль");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("Дублировать X-зазор");

LSTR MSG_HOTEND_OFFSET_X = _UxGT("2-е сопло X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2-е сопло Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2-е сопло Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2-е сопло @");

LSTR MSG_UBL_DOING_G29 = _UxGT("Выполняем G29");
LSTR MSG_UBL_TOOLS = _UxGT("Инструменты UBL");
Expand Down
6 changes: 4 additions & 2 deletions Marlin/src/lcd/language/language_sk.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
* Substitutions are applied for the following characters when used
* in menu items that call lcd_put_u8str_ind_P with an index:
*
* $ displays an inserted C-string
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/
#define DISPLAY_CHARSET_ISO10646_SK

Expand Down Expand Up @@ -172,9 +174,8 @@ namespace Language_sk {
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Zrkadlená kópia");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Plná kontrola");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("Duplik. medz.-X");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2. tryska X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2. tryska Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2. tryska Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2. tryska @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Vykonávam G29");
LSTR MSG_UBL_TOOLS = _UxGT("Nástroje UBL");
LSTR MSG_UBL_LEVEL_BED = _UxGT("UBL rovnanie");
Expand Down Expand Up @@ -300,6 +301,7 @@ namespace Language_sk {
LSTR MSG_MAXSPEED_Y = _UxGT("Max rýchl. ") LCD_STR_B;
LSTR MSG_MAXSPEED_Z = _UxGT("Max rýchl. ") LCD_STR_C;
LSTR MSG_MAXSPEED_E = _UxGT("Max rýchl. ") LCD_STR_E;
LSTR MSG_MAXSPEED_A = _UxGT("Max rýchl. @");
LSTR MSG_BED_Z = _UxGT("Výška podl.");
LSTR MSG_NOZZLE = _UxGT("Tryska");
LSTR MSG_NOZZLE_N = _UxGT("Tryska ~");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_sv.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ namespace Language_sv {
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Speglad Kopia");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Kontroll");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("Duplicera X-Avstånd");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2:a Munstycke X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2:a Munstycke Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2:a Munstycke Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2:a Munstycke @");
LSTR MSG_UBL_DOING_G29 = _UxGT("Utför G29");
LSTR MSG_UBL_TOOLS = _UxGT("UBL Verktyg");
LSTR MSG_UBL_LEVEL_BED = _UxGT("Enad Bädd Nivellering (UBL)");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_tr.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ namespace Language_tr {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Kopyala");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Yansıtılmış kopya");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Tam Kontrol");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2. nozul X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2. nozul Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2. nozul Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2. nozul @");
LSTR MSG_UBL_DOING_G29 = _UxGT("G29 Çalışıyor");
LSTR MSG_UBL_TOOLS = _UxGT("UBL Araçları");
LSTR MSG_UBL_LEVEL_BED = _UxGT("UBL Yatak Hizalama");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_uk.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ namespace Language_uk {
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Повний контроль");
LSTR MSG_IDEX_DUPE_GAP = _UxGT("Дублюв. X-проміжок");

LSTR MSG_HOTEND_OFFSET_X = _UxGT("Друге сопло X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("Друге сопло Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("Друге сопло Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("Друге сопло @");

LSTR MSG_UBL_DOING_G29 = _UxGT("Виконується G29");
LSTR MSG_UBL_TOOLS = _UxGT("Інструменти UBL");
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_zh_CN.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ namespace Language_zh_CN {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("复制");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("镜像复制");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("完全控制");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("第二喷头是X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("第二喷头是Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("第二喷头是Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("第二喷头是@");
LSTR MSG_UBL_DOING_G29 = _UxGT("执行G29"); // "Doing G29"
LSTR MSG_UBL_TOOLS = _UxGT("UBL工具"); // "UBL Tools"
LSTR MSG_UBL_LEVEL_BED = _UxGT("统一热床调平(UBL)"); // "Unified Bed Leveling"
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/lcd/language/language_zh_TW.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ namespace Language_zh_TW {
LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplication");
LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Mirrored Copy");
LSTR MSG_IDEX_MODE_FULL_CTRL = _UxGT("Full Control");
LSTR MSG_HOTEND_OFFSET_X = _UxGT("2nd Nozzle X");
LSTR MSG_HOTEND_OFFSET_Y = _UxGT("2nd Nozzle Y");
LSTR MSG_HOTEND_OFFSET_Z = _UxGT("2nd Nozzle Z");
LSTR MSG_HOTEND_OFFSET_A = _UxGT("2nd Nozzle @");
LSTR MSG_UBL_DOING_G29 = _UxGT("執行G29"); // "Doing G29"
LSTR MSG_UBL_TOOLS = _UxGT("UBL工具"); // "UBL Tools"
LSTR MSG_UBL_LEVEL_BED = _UxGT("統一熱床調平(UBL)"); // "Unified Bed Leveling"
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/lcdprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
*
* Print a string with an index substituted within it:
*
* $ displays the clipped C-string given by the inStr argument
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder
*/
lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const inStr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) {
const uint8_t prop = USE_WIDE_GLYPH ? 2 : 1;
Expand Down Expand Up @@ -72,6 +74,10 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, PGM_P const i
else if (ch == '$' && inStr) {
n -= lcd_put_u8str_max_P(inStr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH);
}
else if (ch == '@') {
lcd_put_wchar(axis_codes[ind]);
n--;
}
else {
lcd_put_wchar(ch);
n -= ch > 255 ? prop : 1;
Expand Down
Loading

0 comments on commit 1de265e

Please sign in to comment.