aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--NEWS3
-rw-r--r--README1
-rwxr-xr-xcheck_for_translation_work.sh20
3 files changed, 24 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index e4128702..848ba7d1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
NEWS
+2016/11/06
+added option of checking for any language file without any translated string and optionaly delete any
+
2016/07/05
added listing of mga6 branch
diff --git a/README b/README
index 2ab4b2e4..85ddceb5 100644
--- a/README
+++ b/README
@@ -20,6 +20,7 @@ FEATURES
-option to exclude all work on web pages translation
-checking and addition of git configuration
-list current branch in each repository if it exists
+-option to check for any language file without any translated string and optionaly delete any
-searching for new *.pot files in svn (TODO also search from git)
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