Browse Source

Prepare adding new language

3d-gussner 4 years ago
parent
commit
9a7a909c6f

+ 1 - 0
Firmware/language.c

@@ -209,6 +209,7 @@ const char* lang_get_name_by_code(uint16_t code)
 	case LANG_CODE_ES: return _n("Espanol");
 	case LANG_CODE_FR: return _n("Francais");
 	case LANG_CODE_IT: return _n("Italiano");
+	case LANG_CODE_NL: return _n("Nederlands");
 	case LANG_CODE_PL: return _n("Polski");
 	}
 	return _n("??");

+ 1 - 0
Firmware/language.h

@@ -95,6 +95,7 @@ typedef struct
 #define LANG_CODE_ES 0x6573 //!<'es'
 #define LANG_CODE_FR 0x6672 //!<'fr'
 #define LANG_CODE_IT 0x6974 //!<'it'
+#define LANG_CODE_NL 0x6e6c //!<'nl'
 #define LANG_CODE_PL 0x706c //!<'pl'
 ///@}
 

+ 0 - 0
lang/Add_new_language.md


+ 6 - 0
lang/fw-build.sh

@@ -158,6 +158,11 @@ 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
@@ -172,6 +177,7 @@ 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
 

+ 2 - 0
lang/fw-clean.sh

@@ -36,6 +36,7 @@ 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
@@ -45,6 +46,7 @@ rm_if_exists update_lang_de.out
 rm_if_exists update_lang_es.out
 rm_if_exists update_lang_fr.out
 rm_if_exists update_lang_it.out
+rm_if_exists update_lang_nl.out
 rm_if_exists update_lang_pl.out
 rm_if_exists lang.bin
 rm_if_exists lang.hex

+ 1 - 0
lang/lang-add.sh

@@ -64,6 +64,7 @@ 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'
 	fi

+ 2 - 0
lang/lang-build.sh

@@ -42,6 +42,7 @@ lang_code_hex_data()
   *es*) echo '\x73\x65' ;;
   *fr*) echo '\x72\x66' ;;
   *it*) echo '\x74\x69' ;;
+  *nl*) echo '\x6c\x6e' ;;
   *pl*) echo '\x6c\x70' ;;
  esac
  echo '??'
@@ -133,6 +134,7 @@ if [ "$1" = "all" ]; then
  generate_binary 'de'
  generate_binary 'es'
  generate_binary 'fr'
+ generate_binary 'nl'
  generate_binary 'it'
  generate_binary 'pl'
 else

+ 1 - 1
lang/lang-check.py

@@ -56,7 +56,7 @@ def main():
         usage="$(prog)s lang")
     parser.add_argument(
         "lang", nargs='?', default="en", type=str,
-        help="Check lang file (en|cs|de|es|fr|it|pl)")
+        help="Check lang file (en|cs|de|es|fr|nl|it|pl)")
     parser.add_argument(
         "--no-warning", action="store_true",
         help="Disable warnings")

+ 1 - 0
lang/lang-clean.sh

@@ -45,6 +45,7 @@ clean_lang de
 clean_lang es
 clean_lang fr
 clean_lang it
+clean_lang nl
 clean_lang pl
 
 echo -n "lang-clean.sh finished" >&2

+ 2 - 0
lang/lang-export.sh

@@ -20,6 +20,7 @@ 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
  exit 0
@@ -46,6 +47,7 @@ else
    *de*) echo "German" ;;
    *es*) echo "Spanish" ;;
    *fr*) echo "French" ;;
+   *nl*) echo "Dutch" ;;
    *it*) echo "Italian" ;;
    *pl*) echo "Polish" ;;
   esac)

+ 50 - 0
lang/lang-import.sh

@@ -52,6 +52,14 @@ if [ "$LNG" = "de" ]; then
  sed -i 's/\xc3\xbc/ue/g' $LNG'_filtered.po'
  #replace 'ö' with 'oe'
  sed -i 's/\xc3\xb6/oe/g' $LNG'_filtered.po'
+ #replace 'Ä' with 'Ae'
+ sed -i 's/\xc3\x84/Ae/g' $LNG'_filtered.po'
+ #replace 'Ü' with 'Ue'
+ sed -i 's/\xc3\x9c/Ue/g' $LNG'_filtered.po'
+ #replace 'Ö' with 'Oe'
+ sed -i 's/\xc3\x96/Oe/g' $LNG'_filtered.po'
+ #replace 'ß' with 'ss'
+ sed -i 's/\xc3\x9f/ss/g' $LNG'_filtered.po'
 fi
 
 #replace in spain translation
@@ -100,6 +108,48 @@ if [ "$LNG" = "it" ]; then
  sed -i 's/\xc3\x88/E/g' $LNG'_filtered.po'
 fi
 
+#replace in dutch translation according to https://nl.wikipedia.org/wiki/Accenttekens_in_de_Nederlandse_spelling
+if [ "$LNG" = "nl" ]; then
+ #replace 'ë' with 'e'
+ sed -i 's/\xc3\xab/e/g' $LNG'_filtered.po'
+ #replace 'ï' with 'i'
+ sed -i 's/\xc3\xaf/i/g' $LNG'_filtered.po'
+ #replace 'é' with 'e'
+ sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
+ #replace 'è' with 'e' (left)
+ sed -i 's/\xc3\xa8/e/g' $LNG'_filtered.po'
+ #replace 'ö' with 'o' (left)
+ sed -i 's/\xc3\xb6/o/g' $LNG'_filtered.po'
+ #replace 'ê' with 'e' (left)
+ sed -i 's/\xc3\xaa/e/g' $LNG'_filtered.po'
+ #replace 'ü' with 'u' (left)
+ sed -i 's/\xc3\xbc/u/g' $LNG'_filtered.po'
+ #replace 'ç' with 'c' (left)
+ sed -i 's/\xc3\xa7/c/g' $LNG'_filtered.po'
+ #replace 'á' with 'a' (left)
+ sed -i 's/\xc3\xa1/a/g' $LNG'_filtered.po'
+ #replace 'à' with 'a' (left)
+ sed -i 's/\xc3\xa0/a/g' $LNG'_filtered.po'
+ #replace 'ä' with 'a' (left)
+ sed -i 's/\xc3\xa4/a/g' $LNG'_filtered.po'
+ #replace 'û' with 'u' (left)
+ sed -i 's/\xc3\xbc/u/g' $LNG'_filtered.po'
+ #replace 'î' with 'i' (left)
+ sed -i 's/\xc3\xae/i/g' $LNG'_filtered.po'
+ #replace 'í' with 'i' (left)
+ sed -i 's/\xc3\xad/i/g' $LNG'_filtered.po'
+ #replace 'ô' with 'o' (left)
+ sed -i 's/\xc3\xb4/o/g' $LNG'_filtered.po'
+ #replace 'ú' with 'u' (left)
+ sed -i 's/\xc3\xba/u/g' $LNG'_filtered.po'
+ #replace 'ñ' with 'n' (left)
+ sed -i 's/\xc3\xb1/n/g' $LNG'_filtered.po'
+ #replace 'â' with 'a' (left)
+ sed -i 's/\xc3\xa2/a/g' $LNG'_filtered.po'
+ #replace 'Å' with 'A' (left)
+ sed -i 's/\xc3\x85/A/g' $LNG'_filtered.po'
+fi
+
 #replace in polish translation
 #if [ "$LNG" = "pl" ]; then
 #fi