Added "All" argument and it is default in nothing is chosen

The script had to started for each language code translation.
Adding the "All" argument and make it as default if nothing is chosen makes the workflow easier.
This commit is contained in:
3d-gussner 2019-08-21 08:39:48 +02:00 committed by GitHub
parent abe054531f
commit 2d4535af1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,19 @@
# for importing translated xx.po
LNG=$1
if [ -z "$LNG" ]; then exit -1; fi
# if no arguments, 'all' is selected (all po and also pot will be generated)
if [ -z "$LNG" ]; then LNG=all; fi
# if 'all' is selected, script will generate all po files and also pot file
if [ "$LNG" = "all" ]; then
./lang-import.sh cz
./lang-import.sh de
./lang-import.sh es
./lang-import.sh fr
./lang-import.sh it
./lang-import.sh pl
exit 0
fi
# language code (iso639-1) is equal to LNG
LNGISO=$LNG
@ -28,43 +40,43 @@ sed -i 's/ \\n/ /g;s/\\n/ /g' $LNG'_filtered.po'
#replace in czech translation
if [ "$LNG" = "cz" ]; then
#replace 'ž' with 'z'
#replace 'ž' with 'z'
sed -i 's/\xc5\xbe/z/g' $LNG'_filtered.po'
#replace 'ì' with 'e'
#replace 'ì' with 'e'
sed -i 's/\xc4\x9b/e/g' $LNG'_filtered.po'
#replace 'í' with 'i'
#replace 'í' with 'i'
sed -i 's/\xc3\xad/i/g' $LNG'_filtered.po'
#replace 'ø' with 'r'
#replace 'ø' with 'r'
sed -i 's/\xc5\x99/r/g' $LNG'_filtered.po'
#replace 'è' with 'c'
#replace 'è' with 'c'
sed -i 's/\xc4\x8d/c/g' $LNG'_filtered.po'
#replace 'á' with 'a'
#replace 'á' with 'a'
sed -i 's/\xc3\xa1/a/g' $LNG'_filtered.po'
#replace 'é' with 'e'
#replace 'é' with 'e'
sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
fi
#replace in german translation
if [ "$LNG" = "de" ]; then
#replace 'ä' with 'ae'
#replace 'ä' with 'ae'
sed -i 's/\xc3\xa4/ae/g' $LNG'_filtered.po'
#replace 'ü' with 'ue'
#replace 'ü' with 'ue'
sed -i 's/\xc3\xbc/ue/g' $LNG'_filtered.po'
#replace 'ö' with 'oe'
#replace 'ö' with 'oe'
sed -i 's/\xc3\xb6/oe/g' $LNG'_filtered.po'
fi
#replace in spain translation
if [ "$LNG" = "es" ]; then
#replace 'á' with 'a'
#replace 'á' with 'a'
sed -i 's/\xc3\xa1/a/g' $LNG'_filtered.po'
#replace '?' with '?'
sed -i 's/\xc2\xbf/?/g' $LNG'_filtered.po'
#replace 'ó' with 'o'
#replace 'ó' with 'o'
sed -i 's/\xc3\xb3/o/g' $LNG'_filtered.po'
#replace 'é' with 'e'
#replace 'é' with 'e'
sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
#replace 'í' with 'i'
#replace 'í' with 'i'
sed -i 's/\xc3\xad/i/g' $LNG'_filtered.po'
#replace '!' with '!'
sed -i 's/\xc2\xa1/!/g' $LNG'_filtered.po'
@ -74,29 +86,29 @@ fi
#replace in french translation
if [ "$LNG" = "fr" ]; then
#replace 'é' with 'e'
#replace 'é' with 'e'
sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
#replace 'É' with 'E'
#replace 'É' with 'E'
sed -i 's/\xc3\x89/E/g' $LNG'_filtered.po'
#replace 'é' with 'e' (left)
#replace 'é' with 'e' (left)
sed -i 's/\xc3\xa8/e/g' $LNG'_filtered.po'
#replace 'á' with 'a' (left)
#replace 'á' with 'a' (left)
sed -i 's/\xc3\xa0/a/g' $LNG'_filtered.po'
fi
#replace in italian translation
if [ "$LNG" = "it" ]; then
#replace 'é' with 'e' (left)
#replace 'é' with 'e' (left)
sed -i 's/\xc3\xa8/e/g' $LNG'_filtered.po'
#replace 'á' with 'a' (left)
#replace 'á' with 'a' (left)
sed -i 's/\xc3\xa0/a/g' $LNG'_filtered.po'
#replace 'ó' with 'o' (left)
#replace 'ó' with 'o' (left)
sed -i 's/\xc3\xb2/o/g' $LNG'_filtered.po'
#replace 'ú' with 'u' (left)
#replace 'ú' with 'u' (left)
sed -i 's/\xc3\xb9/u/g' $LNG'_filtered.po'
#replace 'é' with 'e'
#replace 'é' with 'e'
sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
#replace 'É' with 'E' (left)
#replace 'É' with 'E' (left)
sed -i 's/\xc3\x88/E/g' $LNG'_filtered.po'
fi