diff options
author | filip <filip.komar@gmail.com> | 2016-11-06 22:45:21 +0100 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2016-11-06 22:45:21 +0100 |
commit | d000d3040b98fafc4072d4ebfadf34361c6756c6 (patch) | |
tree | 51a7744c78754f49f0f88a7e5e57af12c226c472 | |
parent | e8385a01be5b83061092dcec67a36d2591048464 (diff) | |
download | tools-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-- | NEWS | 3 | ||||
-rw-r--r-- | README | 1 | ||||
-rwxr-xr-x | check_for_translation_work.sh | 20 |
3 files changed, 24 insertions, 0 deletions
@@ -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 @@ -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 |