Skip to content

Commit

Permalink
Merge pull request prusa3d#2050 from leptun/MK3_fix_languages_lcd3
Browse files Browse the repository at this point in the history
Fix shifted languages. Use \n and \x0a
  • Loading branch information
DRracer authored Jul 26, 2019
2 parents be59868 + 3ddb853 commit da7ce65
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 34 deletions.
6 changes: 5 additions & 1 deletion Firmware/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static void lcd_command(uint8_t value, uint16_t delayExtra = 0)

static void lcd_write(uint8_t value)
{
if (value == '\n' || value == '\r')
if (value == '\n')
{
if (lcd_currline > 3) lcd_currline = -1;
lcd_set_cursor(0, lcd_currline + 1); // LF
Expand Down Expand Up @@ -257,7 +257,9 @@ void lcd_no_display(void)
lcd_displaycontrol &= ~LCD_DISPLAYON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#endif

#ifdef VT100 //required functions for VT100
// Turns the underline cursor on/off
void lcd_no_cursor(void)
{
Expand All @@ -270,7 +272,9 @@ void lcd_cursor(void)
lcd_displaycontrol |= LCD_CURSORON;
lcd_command(LCD_DISPLAYCONTROL | lcd_displaycontrol);
}
#endif

#if 0
// Turn on and off the blinking cursor
void lcd_no_blink(void)
{
Expand Down
4 changes: 2 additions & 2 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4344,7 +4344,7 @@ static void lcd_crash_mode_info()
if ((tim + 1000) < _millis())
{
lcd_clear();
fputs_P(_i("Crash detection can\rbe turned on only in\rNormal mode"), lcdout);////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
fputs_P(_i("Crash detection can\nbe turned on only in\nNormal mode"), lcdout);////MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
tim = _millis();
}
menu_back_if_clicked();
Expand All @@ -4357,7 +4357,7 @@ static void lcd_crash_mode_info2()
if ((tim + 1000) < _millis())
{
lcd_clear();
fputs_P(_i("WARNING:\rCrash detection\rdisabled in\rStealth mode"), lcdout);////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
fputs_P(_i("WARNING:\nCrash detection\ndisabled in\nStealth mode"), lcdout);////MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
tim = _millis();
}
menu_back_if_clicked();
Expand Down
2 changes: 1 addition & 1 deletion lang/fw-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# postbuild.sh - multi-language support script
# Generate binary with secondary language.
Expand Down
2 changes: 1 addition & 1 deletion lang/fw-clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# fw-clean.sh - multi-language support script
# Remove all firmware output files from lang folder.
Expand Down
2 changes: 1 addition & 1 deletion lang/lang-add.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# lang-add.sh - multi-language support script
# add new texts from list (lang_add.txt) to all dictionary files
Expand Down
2 changes: 1 addition & 1 deletion lang/lang-check.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# lang_check.sh - multi-language support script
# check lang_xx.bin (language binary file)
Expand Down
4 changes: 2 additions & 2 deletions lang/lang_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"[0;0] point offset"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"Crash detection can\x0abe turned on only in\x0aNormal mode"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"WARNING:\x0aCrash detection\x0adisabled in\x0aStealth mode"

#
">Cancel"
Expand Down
8 changes: 4 additions & 4 deletions lang/lang_en_cz.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"[0;0] odsazeni bodu"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"Crash detekce muze\rbyt zapnuta pouze v\rNormal modu"
"Crash detection can\x0abe turned on only in\x0aNormal mode"
"Crash detekce muze\x0abyt zapnuta pouze v\x0aNormal modu"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"POZOR:\rCrash detekce\rdeaktivovana ve\rStealth modu"
"WARNING:\x0aCrash detection\x0adisabled in\x0aStealth mode"
"POZOR:\x0aCrash detekce\x0adeaktivovana ve\x0aStealth modu"

#
">Cancel"
Expand Down
8 changes: 4 additions & 4 deletions lang/lang_en_de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"[0;0] Punktversatz"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"Crash Erkennung kann\rnur im Modus Normal\rgenutzt werden"
"Crash detection can\x0abe turned on only in\x0aNormal mode"
"Crash Erkennung kann\x0anur im Modus Normal\x0agenutzt werden"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"WARNUNG:\rCrash Erkennung\rdeaktiviert im\rStealth Modus"
"WARNING:\x0aCrash detection\x0adisabled in\x0aStealth mode"
"WARNUNG:\x0aCrash Erkennung\x0adeaktiviert im\x0aStealth Modus"

#
">Cancel"
Expand Down
8 changes: 4 additions & 4 deletions lang/lang_en_es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"[0;0] punto offset"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"Dec. choque\rpuede ser activada solo en\rModo normal"
"Crash detection can\x0abe turned on only in\x0aNormal mode"
"Dec. choque puede\x0aser activada solo en\x0aModo normal"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"ATENCION:\rDec. choque\rdesactivada en\rModo silencio"
"WARNING:\x0aCrash detection\x0adisabled in\x0aStealth mode"
"ATENCION:\x0aDec. choque\x0adesactivada en\x0aModo silencio"

#
">Cancel"
Expand Down
8 changes: 4 additions & 4 deletions lang/lang_en_fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"Offset point [0;0]"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"La detection de crash peut etre\ractive seulement\ren mode Normal"
"Crash detection can\x0abe turned on only in\x0aNormal mode"
"La detection de\x0acrash peut etre\x0aactive seulement en\x0amode Normal"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"ATTENTION :\rDetection de crash\r desactivee en\rmode Furtif"
"WARNING:\x0aCrash detection\x0adisabled in\x0aStealth mode"
"ATTENTION:\x0aDetection de crash\x0adesactivee en\x0amode Furtif"

#
">Cancel"
Expand Down
8 changes: 4 additions & 4 deletions lang/lang_en_it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"[0;0] punto offset"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"Rilev. impatto\rattivabile solo\rin Modalita normale"
"Crash detection can\x0abe turned on only in\x0aNormal mode"
"Rilev. impatto\x0aattivabile solo\x0ain Modalita normale"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"ATTENZIONE:\rRilev. impatto\rdisattivato in\rModalita silenziosa"
"WARNING:\x0aCrash detection disabled in Stealth mode"
"ATTENZIONE:\x0aRilev. impatto\x0adisattivato in\x0aModalita silenziosa"

#
">Cancel"
Expand Down
8 changes: 4 additions & 4 deletions lang/lang_en_pl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"[0;0] przesuniecie punktu"

#MSG_CRASH_DET_ONLY_IN_NORMAL c=20 r=4
"Crash detection can\rbe turned on only in\rNormal mode"
"Wykrywanie zderzen moze\rbyc wlaczone tylko w\rtrybie Normalnym"
"Crash detection can\x0abe turned on only in\x0aNormal mode"
"Wykrywanie zderzen\x0amoze byc wlaczone\x0atylko w\x0atrybie Normalnym"

#MSG_CRASH_DET_STEALTH_FORCE_OFF c=20 r=4
"WARNING:\rCrash detection\rdisabled in\rStealth mode"
"UWAGA:\rWykrywanie zderzen\rwylaczone w\rtrybie Stealth"
"WARNING:\x0aCrash detection\x0adisabled in\x0aStealth mode"
"UWAGA:\x0aWykrywanie zderzen\x0awylaczone w\x0atrybie Stealth"

#
">Cancel"
Expand Down
3 changes: 2 additions & 1 deletion lang/progmem.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# progmem.sh - multi-language support script
# Examine content of progmem sections (default is progmem1).
Expand Down Expand Up @@ -104,6 +104,7 @@ cat $PROGMEM.chr | \
sed 's/\\x1b/\\\\\\x1b/g;' | \
sed 's/\\x01/\\\\\\x01/g;' | \
sed 's/\\xf8/\\\\\\xf8/g;' | \
sed 's/\\x0a/\\\\\\x0a/g;' | \
sed 's/\\x00$/\n/;s/^/\"/;s/$/\"\\/'; \
) | sh > $PROGMEM.var
Expand Down

0 comments on commit da7ce65

Please sign in to comment.