0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00

updated tool to correctly scrape current format of crowdin.com project translations status

This commit is contained in:
Mike Hardy 2017-12-13 23:54:05 -05:00 committed by Tim Rae
parent de4a8a372f
commit 4217076d81

View File

@ -4,20 +4,26 @@
#
wget -O tmp-translations-page.html https://crowdin.net/project/ankidroid --no-check-certificate
cat tmp-translations-page.html |
tr "\n" " " |
sed -e "s/project-language-name\">/\n/g" |
sed -e "s/.*project-language-name//g" |
sed -e "s/<\/div>//g" |
grep "translated:" |
sed -e "s/<\/strong>.*translated://g" |
sed -e "s/<\/ins>.*//g" |
sed -e 's/[[:space:]]*$//g' |
grep -v " 0%" > tmp-list.txt
egrep 'project-language-name|[approved|translated]: \d+%'|
sed -e "s/<strong.*unselectable\">//g"|
sed -e "s/<\/strong>//g" |
sed -e "s/\w*<\/div>//g" |
sed -e "s/[[:space:]]*//g"|
tr "\n" " " |
tr '%' '\n' |
sed -e "s/^ //g" |
sed -e "s/\:/\: /g" |
grep -v "^\s+$" |
sed -e "s/$/%/g" |
grep -v " 0" > tmp-list.txt
echo "By country:"
cat tmp-list.txt | sort
echo "\nBy rate:"
cat tmp-list.txt | sed -e "s/\(.*\) \([0-9]*\)%/\2% \1/g" | sort -nr
echo "\nBy rate approved (implies 100% translated):"
cat tmp-list.txt | grep approved | sed -e "s/\(.*\) \([0-9]*\)%/\2% \1/g" | sort -nr
echo "\nBy rate translated:"
cat tmp-list.txt | grep translated | sed -e "s/\(.*\) \([0-9]*\)%/\2% \1/g" | sort -nr
rm -f tmp-translations-page.html tmp-list.txt