diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-05-02 11:57:20 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-02 14:24:10 -0700 |
commit | e9e72fa237c3532adf01e535614cd78c8005b3eb (patch) | |
tree | accf3c568404ac296fd5519cc511287e0ffba688 /scripts/countTranslations.sh | |
parent | f16738c3a1009c21aadd79f26d2dc6c69b20f99b (diff) | |
download | subsurface-e9e72fa237c3532adf01e535614cd78c8005b3eb.tar.gz |
add random helper scripts
These are all kinda weird but I use them when creating releases, so it
seems to make sense to add them to the repo. I don't think they are
useful to anyone but me, but in the event someone else takes over, they
might be a useful starting point.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts/countTranslations.sh')
-rw-r--r-- | scripts/countTranslations.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/countTranslations.sh b/scripts/countTranslations.sh new file mode 100644 index 000000000..3fc099926 --- /dev/null +++ b/scripts/countTranslations.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# simply create some stats +if [ ! -d translations ] && [ ! -f translations/subsurface_source.ts ] ; then + echo "please start from the Subsurface source directory" + exit 1 +fi + +cd translations || exit 1 + +STRINGS=$(grep -c source subsurface_source.ts) + +for tr in subsurface_*.ts +do + [ "$tr" = "subsurface_source.ts" ] && continue + [ "$tr" = "subsurface_en_US.ts" ] && continue + MISSING=$(grep -c "translation.*unfinished" "$tr") + PERCENT=$(( (STRINGS - MISSING) * 100 / STRINGS )) + printf "%3d %s\n" "$PERCENT" "$tr" +done | sort -n -r + |