aboutsummaryrefslogtreecommitdiffstats
path: root/check_for_translation_work.sh
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2016-11-06 22:45:21 +0100
committerfilip <filip.komar@gmail.com>2016-11-06 22:45:21 +0100
commitd000d3040b98fafc4072d4ebfadf34361c6756c6 (patch)
tree51a7744c78754f49f0f88a7e5e57af12c226c472 /check_for_translation_work.sh
parente8385a01be5b83061092dcec67a36d2591048464 (diff)
downloadtools-d000d3040b98fafc4072d4ebfadf34361c6756c6.tar
tools-d000d3040b98fafc4072d4ebfadf34361c6756c6.tar.gz
tools-d000d3040b98fafc4072d4ebfadf34361c6756c6.tar.bz2
tools-d000d3040b98fafc4072d4ebfadf34361c6756c6.tar.xz
tools-d000d3040b98fafc4072d4ebfadf34361c6756c6.zip
added option of checking for any language file without any translated string
and optionaly delete any
Diffstat (limited to 'check_for_translation_work.sh')
-rwxr-xr-xcheck_for_translation_work.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/check_for_translation_work.sh b/check_for_translation_work.sh
index d6060cb7..33733008 100755
--- a/check_for_translation_work.sh
+++ b/check_for_translation_work.sh
@@ -104,6 +104,12 @@ color_for_differences=31
# uncomment next line to prevent creation of working copy of po file
#create_a_working_copy_of_po_file=no
+# check for any language file without any translated string
+# check_for_empty_translations=1
+
+# delete all language files without any translated string
+# delete_empty_translations=1
+
EOF
echo -e "\E[31m"
@@ -290,6 +296,20 @@ do
if [ $? -ne 0 ]; then
echo "Pot file not found in $git_directory/${translate_projects_po[$translate_project_name_po]}/. Please report that on our mailing list." | tee -a "$logfile"_this_run.log
fi
+ if [ $check_for_empty_translations -eq 1 ]; then
+ for filename in *.po
+ do
+ msgattrib $filename --translated | grep . >> /dev/null
+ if [ $? -eq 1 ]; then
+ msgfmt --statistics --verbose -o /dev/null $filename
+ echo "Filename $filename has no translated strings."
+ if [ $delete_empty_translations -eq 1 ]; then
+ rm $filename
+ fi
+ echo ''
+ fi
+ done
+ fi
fi
# checking for fuzzy and untranslated strings in git $language_code.po