123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #!/bin/sh
- LNG=$1
- if [ -z "$LNG" ]; then exit -1; fi
- LNGISO=$LNG
- if [ "$LNG" = "cz" ]; then LNGISO=cs; fi
- cd po/new
- if ! [ -e $LNGISO.po ]; then
- echo "Input file $LNGISO.po not found!" >&2
- exit -1
- fi
- cat $LNGISO.po | sed 's/\\e/\\x1b/g;s/\\\\/\\/g' > $LNG'_filtered.po'
- sed -i 's/ \\n/ /g;s/\\n/ /g' $LNG'_filtered.po'
- if [ "$LNG" = "cz" ]; then
-
- sed -i 's/\xc5\xbe/z/g' $LNG'_filtered.po'
-
- sed -i 's/\xc4\x9b/e/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xad/i/g' $LNG'_filtered.po'
-
- sed -i 's/\xc5\x99/r/g' $LNG'_filtered.po'
-
- sed -i 's/\xc4\x8d/c/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa1/a/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
- fi
- if [ "$LNG" = "de" ]; then
-
- sed -i 's/\xc3\xa4/ae/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xbc/ue/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xb6/oe/g' $LNG'_filtered.po'
- fi
- if [ "$LNG" = "es" ]; then
-
- sed -i 's/\xc3\xa1/a/g' $LNG'_filtered.po'
-
- sed -i 's/\xc2\xbf/?/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xb3/o/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xad/i/g' $LNG'_filtered.po'
-
- sed -i 's/\xc2\xa1/!/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xb1/n/g' $LNG'_filtered.po'
- fi
- if [ "$LNG" = "fr" ]; then
-
- sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\x89/E/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa8/e/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa0/a/g' $LNG'_filtered.po'
- fi
- if [ "$LNG" = "it" ]; then
-
- sed -i 's/\xc3\xa8/e/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa0/a/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xb2/o/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xb9/u/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
-
- sed -i 's/\xc3\x88/E/g' $LNG'_filtered.po'
- fi
- if grep --color='auto' -P -n '[^\x00-\x7F]' $LNG'_filtered.po' >nonasci.txt; then
- exit
- fi
- cat $LNG'_filtered.po' | sed ':a;N;$!ba;s/\x22\n\x22//g' > $LNG'_new.po'
- cat ../../lang_en.txt | sed 's/\\/\\\\/g' | while read -r s; do
- /bin/echo -e "$s"
- if [ "${s:0:1}" = "\"" ]; then
- s=$(/bin/echo -e "$s")
- s2=$(grep -F -A1 -B0 "$s" "$LNG"_new.po | tail -n1 | sed 's/^msgstr //')
- if [ -z "$s2" ]; then
- echo '"\x00"'
- else
- echo "$s2"
- fi
- fi
- done > lang_en_$LNG.txt
|