aboutsummaryrefslogtreecommitdiffhomepage
path: root/markup/pod/live-manual/media/text/bin/count-untranslated-strings.sh
blob: 1087df1754e96bf8e315ed7ba31f20dab1c6ddca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 }'