From d000d3040b98fafc4072d4ebfadf34361c6756c6 Mon Sep 17 00:00:00 2001 From: filip Date: Sun, 6 Nov 2016 22:45:21 +0100 Subject: added option of checking for any language file without any translated string and optionaly delete any --- check_for_translation_work.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'check_for_translation_work.sh') 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 -- cgit v1.2.1