Improve lang import and cleanup

This commit is contained in:
3d-gussner 2022-03-16 09:23:34 +01:00
parent 85a5986e9e
commit 19b4c333c0
3 changed files with 11 additions and 7 deletions

2
.gitignore vendored
View File

@ -60,7 +60,7 @@ config.tmp
/lang/po/new/*_filered.po
/lang/po/new/nonascii.txt
/lang/po/new/lang_en*.txt
/lang/po/new/*-output.txt
/lang/po/new/output-*.txt
/lang/po/new/*.mo
.DS_Store
**/.DS_Store

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# Version 1.0.1 Build 12
# Version 1.0.1 Build 13
#
# clean.sh - multi-language support script
# Remove all language output files from lang folder.
@ -26,6 +26,7 @@
# to get Build Nr
# 25 Jan. 2022, 3d-gussner, clean up lang-import.sh temproray files
# 14 Feb. 2022, 3d-gussner, Fix single language run without config.sh OK
# 16 Mar. 2022, 3d-gussner, Cleanup `output-layout/sorted-??.txt`
#############################################################################
result=0
@ -58,7 +59,8 @@ clean_lang()
rm_if_exists po/new/$1.mo
rm_if_exists po/new/$1_filtered.po
rm_if_exists po/new/lang_en_$1.txt
rm_if_exists po/new/$1-output.txt
rm_if_exists po/new/output-layout-$1.txt
rm_if_exists po/new/output-sorted-$1.txt
fi
rm_if_exists lang_$1_check.dif
rm_if_exists lang_$1.bin

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# Version 1.0.1 Build 45
# Version 1.0.1 Build 46
#
# lang-import.sh - multi-language support script
# for importing translated xx.po
@ -277,9 +277,9 @@ fi
#https://en.wikipedia.org/wiki/Norwegian_orthography éèêóòôù ÅåÆæØø
if [ "$LNG" = "no" ]; then
#replace UTF-8 'æÆøØ' to HD44780 A00 'äö'
#repace 'Æ' with 'Ae'
#repace 'Æ' with 'Ä'
sed -i 's/\xc3\x86/\\xe1/g' $LNG'_filtered.po'
#repace 'æ' with 'ae'
#repace 'æ' with 'ä'
sed -i 's/\xc3\xa6/\\xe1/g' $LNG'_filtered.po'
#repace 'Ø' with 'Ö'
sed -i 's/\xc3\x98/\\xef/g' $LNG'_filtered.po'
@ -507,7 +507,9 @@ sed -i "s/\r//g" lang_en_$LNG.txt
#check new lang
python3 ../../lang-check.py $LNG --warn-empty
python3 ../../lang-check.py $LNG --information >$LNG-output.txt
#gerenate some output
python3 ../../lang-check.py $LNG --information >output-layout-$LNG.txt
grep "msgstr" $LNGISO.po | cut -d '"' -f2 | sort >output-sorted-$LNG.txt
echo >&2
echo "$(tput setaf 2)lang-import.sh finished$(tput sgr 0)">&2