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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
878 B
Bash
Raw Permalink Normal View History

#!/bin/sh
#
# Shows the completion rate of the translation for each language.
#
2015-01-28 16:54:00 +01:00
wget -O tmp-translations-page.html https://crowdin.net/project/ankidroid --no-check-certificate
cat tmp-translations-page.html |
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
2011-11-16 10:16:55 +01:00
echo "By country:"
cat tmp-list.txt | sort
echo -e "\nBy rate approved (implies 100% translated):"
cat tmp-list.txt | grep approved | sed -e "s/\(.*\) \([0-9]*\)%/\2% \1/g" | sort -nr
echo -e "\nBy rate translated:"
cat tmp-list.txt | grep translated | sed -e "s/\(.*\) \([0-9]*\)%/\2% \1/g" | sort -nr
2011-11-16 10:16:55 +01:00
2014-10-21 15:23:22 +02:00
rm -f tmp-translations-page.html tmp-list.txt