New lang, arduino 1.8.5 - removed po files (will be solved other way)
This commit is contained in:
parent
0d9b502937
commit
3c232a763b
1717
lang/po/lang.pot
1717
lang/po/lang.pot
File diff suppressed because it is too large
Load Diff
1722
lang/po/lang_cz.po
1722
lang/po/lang_cz.po
File diff suppressed because it is too large
Load Diff
1788
lang/po/lang_de.po
1788
lang/po/lang_de.po
File diff suppressed because it is too large
Load Diff
1796
lang/po/lang_es.po
1796
lang/po/lang_es.po
File diff suppressed because it is too large
Load Diff
1791
lang/po/lang_it.po
1791
lang/po/lang_it.po
File diff suppressed because it is too large
Load Diff
1788
lang/po/lang_pl.po
1788
lang/po/lang_pl.po
File diff suppressed because it is too large
Load Diff
@ -1,114 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# make_po.sh - multi-language support script
|
||||
# for generating lang_xx.po
|
||||
#
|
||||
SRCDIR="../../Firmware"
|
||||
#
|
||||
LNG=$1
|
||||
if [ -z "$LNG" ]; then LNG=cz; fi
|
||||
#
|
||||
|
||||
if [ "$LNG" == "all" ]; then
|
||||
./make_po.sh cz
|
||||
./make_po.sh de
|
||||
./make_po.sh es
|
||||
./make_po.sh it
|
||||
./make_po.sh pl
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "make_po.sh started" >&2
|
||||
echo " selected language=$LNG" >&2
|
||||
|
||||
#remove output file if exists
|
||||
if [ -e lang_$LNG.po ]; then rm lang_$LNG.po; fi
|
||||
|
||||
lang_name=$(\
|
||||
case "$LNG" in
|
||||
*en*) echo "English" ;;
|
||||
*cz*) echo "Czech" ;;
|
||||
*de*) echo "German" ;;
|
||||
*es*) echo "Spanish" ;;
|
||||
*it*) echo "Italian" ;;
|
||||
*pl*) echo "Polish" ;;
|
||||
esac)
|
||||
|
||||
lang_short=$(\
|
||||
case "$LNG" in
|
||||
*en*) echo "en" ;;
|
||||
*cz*) echo "cs" ;;
|
||||
*de*) echo "de" ;;
|
||||
*it*) echo "it" ;;
|
||||
*es*) echo "es" ;;
|
||||
*pl*) echo "pl" ;;
|
||||
esac)
|
||||
|
||||
po_date=$(date)
|
||||
|
||||
#write po header
|
||||
echo "# Translation of Prusa-Firmware into $lang_name." > lang_$LNG.po
|
||||
echo "#" >> lang_$LNG.po
|
||||
echo 'msgid ""' >> lang_$LNG.po
|
||||
echo 'msgstr ""' >> lang_$LNG.po
|
||||
echo '"MIME-Version: 1.0\n"' >> lang_$LNG.po
|
||||
echo '"Content-Type: text/plain; charset=UTF-8\n"' >> lang_$LNG.po
|
||||
echo '"Content-Transfer-Encoding: 8bit\n"' >> lang_$LNG.po
|
||||
echo '"Language: '$lang_short'\n"' >> lang_$LNG.po
|
||||
echo '"Project-Id-Version: Prusa-Firmware\n"' >> lang_$LNG.po
|
||||
echo '"POT-Creation-Date: '$po_date'\n"' >> lang_$LNG.po
|
||||
echo '"PO-Revision-Date: '$po_date'\n"' >> lang_$LNG.po
|
||||
echo '"Language-Team: \n"' >> lang_$LNG.po
|
||||
echo '"X-Generator: Poedit 2.0.7\n"' >> lang_$LNG.po
|
||||
echo '"X-Poedit-SourceCharset: UTF-8\n"' >> lang_$LNG.po
|
||||
echo '"Last-Translator: \n"' >> lang_$LNG.po
|
||||
echo '"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"' >> lang_$LNG.po
|
||||
echo >> lang_$LNG.po
|
||||
|
||||
#list .cpp, .c and .h files
|
||||
files=$(ls "$SRCDIR"/*.cpp "$SRCDIR"/*.c "$SRCDIR"/*.h)
|
||||
|
||||
num_texts=$(grep '^#' -c ../lang_en_$LNG.txt)
|
||||
num_texts_nt=$(grep '^\"\\x00\"' -c ../lang_en_$LNG.txt)
|
||||
echo " $num_texts texts, $num_texts_nt not translated" >&2
|
||||
|
||||
#loop over all messages
|
||||
s0=''
|
||||
s1=''
|
||||
s2=''
|
||||
num=1
|
||||
cat ../lang_en_$LNG.txt | sed "s/\\\\/\\\\\\\\/g" | while read -r s; do
|
||||
if [ "$s" == "" ]; then
|
||||
echo " processing $num of $num_texts" >&2
|
||||
if [ "$s0" == "\"\\\\x00\"" ]; then
|
||||
search=$(/bin/echo -e "$s1")
|
||||
found=$(grep -m1 -n -F "$search" $files | head -n1 | cut -f1-2 -d':' | sed "s/^.*\///")
|
||||
echo "$s2" | sed 's/ c=0//;s/ r=0//;s/^#/# /'
|
||||
echo "#: $found"
|
||||
echo "#, fuzzy"
|
||||
/bin/echo -e "msgid $s1"
|
||||
echo 'msgstr ""'
|
||||
echo
|
||||
else
|
||||
search=$(/bin/echo -e "$s1")
|
||||
found=$(grep -m1 -n -F "$search" $files | head -n1 | cut -f1-2 -d':' | sed "s/^.*\///")
|
||||
echo "$s2" | sed 's/ c=0//;s/ r=0//;s/^#/# /'
|
||||
echo "#: $found"
|
||||
/bin/echo -e "msgid $s1"
|
||||
/bin/echo -e "msgstr $s0"
|
||||
echo
|
||||
fi
|
||||
num=$((num+1))
|
||||
fi
|
||||
s2=$s1
|
||||
s1=$s0
|
||||
s0=$s
|
||||
done >> lang_$LNG.po
|
||||
|
||||
#replace LF with CRLF
|
||||
sync
|
||||
sed -i 's/$/\r/' lang_$LNG.po
|
||||
|
||||
echo "make_po.sh finished" >&2
|
||||
#read
|
||||
exit 0
|
@ -1,86 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# make_pot.sh - multi-language support script
|
||||
# Generate lang.pot
|
||||
#
|
||||
SRCDIR="../../Firmware"
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
echo "make_pot.sh started" >&2
|
||||
|
||||
#remove output file if exists
|
||||
if [ -e lang.pot ]; then rm lang.pot; fi
|
||||
|
||||
lang_name="English"
|
||||
lang_short="en"
|
||||
|
||||
po_date=$(date)
|
||||
|
||||
#cat ../lang_en_cz.txt | sed "/^$/d;/^#/d" | sed '{N;s/\n/ /}' | sed -n '/\"\\x00\"$/p' | sed 's/ \"\\x00\"$//' > lang_pot_cz.tmp
|
||||
#cat ../lang_en_de.txt | sed "/^$/d;/^#/d" | sed '{N;s/\n/ /}' | sed -n '/\"\\x00\"$/p' | sed 's/ \"\\x00\"$//' > lang_pot_de.tmp
|
||||
#cat ../lang_en_es.txt | sed "/^$/d;/^#/d" | sed '{N;s/\n/ /}' | sed -n '/\"\\x00\"$/p' | sed 's/ \"\\x00\"$//' > lang_pot_es.tmp
|
||||
#cat ../lang_en_it.txt | sed "/^$/d;/^#/d" | sed '{N;s/\n/ /}' | sed -n '/\"\\x00\"$/p' | sed 's/ \"\\x00\"$//' > lang_pot_it.tmp
|
||||
#cat ../lang_en_pl.txt | sed "/^$/d;/^#/d" | sed '{N;s/\n/ /}' | sed -n '/\"\\x00\"$/p' | sed 's/ \"\\x00\"$//' > lang_pot_pl.tmp
|
||||
|
||||
#cat lang_pot_cz.tmp lang_pot_de.tmp lang_pot_es.tmp lang_pot_it.tmp lang_pot_pl.tmp | sort -u > lang_pot.tmp
|
||||
|
||||
#cat ../lang_en.txt | sed "/^$/d;/^#/d" > lang_pot.tmp
|
||||
|
||||
|
||||
#write po header
|
||||
echo "# Translation of Prusa-Firmware into $lang_name." > lang.pot
|
||||
echo "#" >> lang.pot
|
||||
echo 'msgid ""' >> lang.pot
|
||||
echo 'msgstr ""' >> lang.pot
|
||||
echo '"MIME-Version: 1.0\n"' >> lang.pot
|
||||
echo '"Content-Type: text/plain; charset=UTF-8\n"' >> lang.pot
|
||||
echo '"Content-Transfer-Encoding: 8bit\n"' >> lang.pot
|
||||
echo '"Language: '$lang_short'\n"' >> lang.pot
|
||||
echo '"Project-Id-Version: Prusa-Firmware\n"' >> lang.pot
|
||||
echo '"POT-Creation-Date: '$po_date'\n"' >> lang.pot
|
||||
echo '"PO-Revision-Date: '$po_date'\n"' >> lang.pot
|
||||
echo '"Language-Team: \n"' >> lang.pot
|
||||
echo '"X-Generator: Poedit 2.0.7\n"' >> lang.pot
|
||||
echo '"X-Poedit-SourceCharset: UTF-8\n"' >> lang.pot
|
||||
echo '"Last-Translator: \n"' >> lang.pot
|
||||
echo '"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"' >> lang.pot
|
||||
echo >> lang.pot
|
||||
|
||||
#list .cpp, .c and .h files
|
||||
files=$(ls "$SRCDIR"/*.cpp "$SRCDIR"/*.c "$SRCDIR"/*.h)
|
||||
|
||||
num_texts=$(grep '^#' -c ../lang_en.txt)
|
||||
#num_texts_nt=$(grep '^"' -c lang_en.txt)
|
||||
#echo " $num_texts texts, $num_texts_nt not translated" >&2
|
||||
echo " $num_texts texts" >&2
|
||||
|
||||
#loop over all messages
|
||||
s0=''
|
||||
s1=''
|
||||
num=1
|
||||
cat ../lang_en.txt | sed "s/\\\\/\\\\\\\\/g" | while read -r s; do
|
||||
if [ -z "$s" ]; then
|
||||
echo " processing $num of $num_texts" >&2
|
||||
search=$(/bin/echo -e "$s0")
|
||||
found=$(grep -m1 -n -F "$search" $files | head -n1 | cut -f1-2 -d':' | sed "s/^.*\///")
|
||||
echo "$s1" | sed 's/ c=0//;s/ r=0//;s/^#/# /'
|
||||
echo "#: $found"
|
||||
#echo "#, fuzzy"
|
||||
/bin/echo -e "msgid $s0"
|
||||
echo 'msgstr ""'
|
||||
echo
|
||||
num=$((num+1))
|
||||
fi
|
||||
s1=$s0
|
||||
s0=$s
|
||||
done >> lang.pot
|
||||
|
||||
#replace LF with CRLF
|
||||
sync
|
||||
sed -i 's/$/\r/' lang.pot
|
||||
|
||||
echo "make_pot.sh finished" >&2
|
||||
read
|
||||
exit 0
|
1873
lang/po_new/de.po
1873
lang/po_new/de.po
File diff suppressed because it is too large
Load Diff
1708
lang/po_new/es.po
1708
lang/po_new/es.po
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
#
|
||||
|
||||
LNG=$1
|
||||
if [ -z "$LNG" ]; then exit -1; fi
|
||||
|
||||
#convert '\\e' sequencies to 'x1b' and '\\' to '\'
|
||||
cat $LNG.po | sed 's/\\\\e/\\x1b/g;s/\\\\/\\/g' > $LNG'_filtered.po'
|
||||
|
||||
#join lines with multi-line string constants
|
||||
cat $LNG'_filtered.po' | sed ':a;N;$!ba;s/\x22\n\x22//g' > $LNG'_new.po'
|
||||
|
||||
#generate dictionary
|
||||
cat ../lang_en.txt | sed 's/\\/\\\\/g' | while read -r s; do
|
||||
/bin/echo -e "$s"
|
||||
if [ "${s:0:1}" = "\"" ]; then
|
||||
# /bin/echo -e "$s"
|
||||
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
|
||||
# echo
|
||||
fi
|
||||
done > lang_en_$LNG.txt
|
Loading…
Reference in New Issue
Block a user