From 779c8d0a7808785d507b0a8b6f2ee472c3d86f39 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 1 Mar 2021 08:28:08 +0100 Subject: [PATCH] Move `Dutch` language parts Not create community languages with `lang-build.sh all` the `lang-community.sh` will call it. Add templates for future community languages --- lang/fw-build.sh | 29 +++++++++++++++++++++++------ lang/fw-clean.sh | 8 +++++++- lang/lang-add.sh | 8 +++++++- lang/lang-build.sh | 9 +++++++-- lang/lang-clean.sh | 8 +++++++- lang/lang-export.sh | 16 +++++++++++++--- lang/lang-import.sh | 1 + 7 files changed, 65 insertions(+), 14 deletions(-) diff --git a/lang/fw-build.sh b/lang/fw-build.sh index 9518964b..12a9ed51 100755 --- a/lang/fw-build.sh +++ b/lang/fw-build.sh @@ -158,16 +158,27 @@ else ./update_lang.sh fr 2>./update_lang_fr.out 1>/dev/null if [ $? -eq 0 ]; then echo 'OK' >&2; else echo 'NG!' >&2; finish 1; fi fi - if [ -e lang_nl.bin ]; then - echo -n " Dutch : " >&2 - ./update_lang.sh nl 2>./update_lang_nl.out 1>/dev/null - if [ $? -eq 0 ]; then echo 'OK' >&2; else echo 'NG!' >&2; fi - fi if [ -e lang_pl.bin ]; then echo -n " Polish : " >&2 ./update_lang.sh pl 2>./update_lang_pl.out 1>/dev/null if [ $? -eq 0 ]; then echo 'OK' >&2; else echo 'NG!' >&2; finish 1; fi fi +#Community language support +#Dutch + if [ -e lang_nl.bin ]; then + echo -n " Dutch : " >&2 + ./update_lang.sh nl 2>./update_lang_nl.out 1>/dev/null + if [ $? -eq 0 ]; then echo 'OK' >&2; else echo 'NG!' >&2; fi + fi + +#Use the 6 lines below as a template and replace 'qr' and 'New language' +#New language +# if [ -e lang_qr.bin ]; then +# echo -n " New language : " >&2 +# ./update_lang.sh qr 2>./update_lang_qr.out 1>/dev/null +# if [ $? -eq 0 ]; then echo 'OK' >&2; else echo 'NG!' >&2; fi +# fi + # echo "skipped" >&2 fi @@ -177,9 +188,15 @@ if [ -e lang_cz.bin ]; then cat lang_cz.bin >> lang.bin; fi if [ -e lang_de.bin ]; then cat lang_de.bin >> lang.bin; fi if [ -e lang_es.bin ]; then cat lang_es.bin >> lang.bin; fi if [ -e lang_fr.bin ]; then cat lang_fr.bin >> lang.bin; fi -if [ -e lang_nl.bin ]; then cat lang_nl.bin >> lang.bin; fi if [ -e lang_it.bin ]; then cat lang_it.bin >> lang.bin; fi if [ -e lang_pl.bin ]; then cat lang_pl.bin >> lang.bin; fi +#Community language support +# Dutch +if [ -e lang_nl.bin ]; then cat lang_nl.bin >> lang.bin; fi + +#Use the 2 lines below as a template and replace 'qr' +## New language +#if [ -e lang_qr.bin ]; then cat lang_qr.bin >> lang.bin; fi #convert lang.bin to lang.hex echo -n " converting to hex..." >&2 diff --git a/lang/fw-clean.sh b/lang/fw-clean.sh index 180bf9d0..47f26f86 100755 --- a/lang/fw-clean.sh +++ b/lang/fw-clean.sh @@ -36,7 +36,6 @@ rm_if_exists firmware_de.hex rm_if_exists firmware_es.hex rm_if_exists firmware_fr.hex rm_if_exists firmware_it.hex -rm_if_exists firmware_nl.hex rm_if_exists firmware_pl.hex rm_if_exists progmem.out rm_if_exists textaddr.out @@ -50,6 +49,13 @@ rm_if_exists update_lang_nl.out rm_if_exists update_lang_pl.out rm_if_exists lang.bin rm_if_exists lang.hex +#Community language support +#Dutch +rm_if_exists firmware_nl.hex + +#Use the 2 lines below as a template and replace 'qr' +##New language +#rm_if_exists firmware_qr.hex echo -n "fw-clean.sh finished" >&2 if [ $result -eq 0 ]; then diff --git a/lang/lang-add.sh b/lang/lang-add.sh index 6f3cc56c..f55d603e 100755 --- a/lang/lang-add.sh +++ b/lang/lang-add.sh @@ -64,9 +64,15 @@ cat lang_add.txt | sed 's/^/"/;s/$/"/' | while read new_s; do insert_xx "$new_s" 'de' insert_xx "$new_s" 'es' insert_xx "$new_s" 'fr' - insert_xx "$new_s" 'nl' insert_xx "$new_s" 'it' insert_xx "$new_s" 'pl' +#Community language support +#Dutch + insert_xx "$new_s" 'nl' + +#Use the 2 lines below as a template and replace 'qr' +##New language +# insert_xx "$new_s" 'qr' fi done diff --git a/lang/lang-build.sh b/lang/lang-build.sh index 9d9de1c6..543ebc96 100755 --- a/lang/lang-build.sh +++ b/lang/lang-build.sh @@ -42,8 +42,13 @@ lang_code_hex_data() *es*) echo '\x73\x65' ;; *fr*) echo '\x72\x66' ;; *it*) echo '\x74\x69' ;; - *nl*) echo '\x6c\x6e' ;; *pl*) echo '\x6c\x70' ;; +#Community language support +#Dutch + *nl*) echo '\x6c\x6e' ;; +#Use the 2 lines below as a template and replace 'qr' and `\x71\x72` +##New language +# *qr*) echo '\x71\x72' ;; esac echo '??' } @@ -134,9 +139,9 @@ if [ "$1" = "all" ]; then generate_binary 'de' generate_binary 'es' generate_binary 'fr' - generate_binary 'nl' generate_binary 'it' generate_binary 'pl' + #DO NOT add Community languages here else generate_binary $1 fi diff --git a/lang/lang-clean.sh b/lang/lang-clean.sh index 2dd5c4cd..cf7d08c4 100755 --- a/lang/lang-clean.sh +++ b/lang/lang-clean.sh @@ -45,8 +45,14 @@ clean_lang de clean_lang es clean_lang fr clean_lang it -clean_lang nl clean_lang pl +#Community language support +#Dutch +clean_lang nl + +#Use the 2 lines below as a template and replace 'qr' +##New language +#clean_lang_qr echo -n "lang-clean.sh finished" >&2 if [ $result -eq 0 ]; then diff --git a/lang/lang-export.sh b/lang/lang-export.sh index e33232c4..2ab91342 100755 --- a/lang/lang-export.sh +++ b/lang/lang-export.sh @@ -20,9 +20,14 @@ if [ "$LNG" = "all" ]; then ./lang-export.sh de ./lang-export.sh es ./lang-export.sh fr - ./lang-export.sh nl ./lang-export.sh it ./lang-export.sh pl +#Community language support +#Dutch + ./lang-export.sh nl +#Use the 2 lines below as a template and replace 'qr' and 'New language' +##New language +# ./lang-export.sh qr exit 0 fi @@ -47,9 +52,14 @@ else *de*) echo "German" ;; *es*) echo "Spanish" ;; *fr*) echo "French" ;; - *nl*) echo "Dutch" ;; - *it*) echo "Italian" ;; + *it*) echo "Italian" ;; *pl*) echo "Polish" ;; +#Community language support +#Dutch + *nl*) echo "Dutch" ;; +#Use the 2 lines below as a template and replace 'qr' and 'New language' +##New language +# *qr*) echo "New language" ;; esac) # unknown language - error if [ -z "LNGNAME" ]; then diff --git a/lang/lang-import.sh b/lang/lang-import.sh index 4bf77d50..dae9c0e7 100755 --- a/lang/lang-import.sh +++ b/lang/lang-import.sh @@ -15,6 +15,7 @@ if [ "$LNG" = "all" ]; then ./lang-import.sh fr ./lang-import.sh it ./lang-import.sh pl +#DO NOT add Community languages here !!! exit 0 fi