diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2021-11-27 21:54:49 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2021-11-27 21:54:49 -0500 |
commit | 78b1b83be0cf04b4cba707751b7ad4d97787fe37 (patch) | |
tree | 0260daae62c3c0c055b7ec73b274fa82b31b344f /markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh |
track document samples used
Diffstat (limited to 'markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh')
-rwxr-xr-x | markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh b/markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh new file mode 100755 index 0000000..1087df1 --- /dev/null +++ b/markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +# Count total number of untranslated strings in live-manual + +Count_untranslated_strings () +{ +for POFILE in manual/po/*/* + do + if [ "$(sed '$!d' ${POFILE})" = 'msgstr ""' ] + then + sed '$G' ${POFILE} | grep --extended-regexp --before-context=1 '^$' | grep --count '^msgstr ""$' || continue + else + grep --extended-regexp --before-context=1 '^$' ${POFILE} | grep --count '^msgstr ""$' || continue + fi + done +} + +Count_untranslated_strings | awk '{ sum += $1 } END { print sum }' |