From d88232dcb27df35a45ed8c8e547eceffb1086d8f Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 1 Nov 2013 15:20:11 +0100 Subject: added option to exclude all work on web pages translation --- check_for_translation_work.sh | 116 ++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 55 deletions(-) (limited to 'check_for_translation_work.sh') diff --git a/check_for_translation_work.sh b/check_for_translation_work.sh index 1bac2f78..8bee84aa 100755 --- a/check_for_translation_work.sh +++ b/check_for_translation_work.sh @@ -7,7 +7,7 @@ # # Filip Komar, 2012, 2013 # Remco Rijnders, 2012 -# $Id: check_for_translation_work.sh 8703 2013-10-31 22:47:00 filip $ +# $Id: check_for_translation_work.sh 2013-11-01 14:18:00 UTC filip $ # # Please see git for a list of changes to this script. # @@ -58,6 +58,9 @@ copying_po=1 # uncomment next line to exclude work on html software resources #work_on_html_software_files=no +# uncomment next line to exclude all work on web pages translation +#work_on_web_pages_translation + # set copying of web page files with 1 copying_wp=1 @@ -126,9 +129,11 @@ if [ -f "$logfile"_this_run.log ]; then fi separator="-----------------------------------------------------" -# Check if directories exist and create them if not -if [ ! -d "$svn_directory" ]; then - mkdir -vp "$svn_directory/" # | tee -a "$logfile"_this_run.log +if [ -z "$work_on_web_pages_translation" ]; then + # Check if directories exist and create them if not + if [ ! -d "$svn_directory" ]; then + mkdir -vp "$svn_directory/" # | tee -a "$logfile"_this_run.log + fi fi if [ ! -d "$git_directory" ]; then mkdir -vp "$git_directory/" # | tee -a "$logfile"_this_run.log @@ -475,66 +480,67 @@ do fi done - -# Check out / update web_page files -echo -e "\E[32m" -echo "Check out / update web page files:" | tee -a "$logfile"_this_run.log -echo "" >> "$log_directory"/list_of_resources_for_translation.txt -echo "Please check http://www.mageia.org/langs/report.php for details about translation of web page files in $language_code language." >> "$log_directory"/list_of_resources_for_translation.txt -echo -e "\E[m" -for web_page_name in "${!web_pages[@]}" -do - echo $separator | tee -a "$logfile"_this_run.log - echo Working on: "$web_page_name" from "${web_pages[$web_page_name]}". | tee -a "$logfile"_this_run.log # \' - if [ -d "$svn_directory/$web_page_name/" ]; then - cd "$svn_directory/$web_page_name/" -# just echo $language_code.lang or *.php file line if they are updated - svn up | grep -E "$language_code.lang|en.lang|.php" | tee -a "$logfile"_this_run.log -# echo -n "" # debug - else - cd "$svn_directory/" -# just echo $language_code.lang or *.php file line if they are updated - svn co $svn_method${web_pages[$web_page_name]} $web_page_name | grep -E "$language_code.lang|en.lang|.php" | tee -a "$logfile"_this_run.log - echo -n "" | tee -a "$logfile"_this_run.log - cd "$svn_directory/$web_page_name/" - fi -# echo "" | tee -a "$logfile"_this_run.log -done - - -#copying the english files and $language_code.lang files for editing in working directory if required -if [ $copying_wp -eq 1 ]; then - echo $separator | tee -a "$logfile"_this_run.log +if [ -z "$work_on_web_pages_translation" ]; then + # Check out / update web_page files echo -e "\E[32m" - echo "Web files will be copied (updated) into working translations directory." + echo "Check out / update web page files:" | tee -a "$logfile"_this_run.log + echo "" >> "$log_directory"/list_of_resources_for_translation.txt + echo "Please check http://www.mageia.org/langs/report.php for details about translation of web page files in $language_code language." >> "$log_directory"/list_of_resources_for_translation.txt echo -e "\E[m" - cd "$svn_directory/" + for web_page_name in "${!web_pages[@]}" + do + echo $separator | tee -a "$logfile"_this_run.log + echo Working on: "$web_page_name" from "${web_pages[$web_page_name]}". | tee -a "$logfile"_this_run.log # \' + if [ -d "$svn_directory/$web_page_name/" ]; then + cd "$svn_directory/$web_page_name/" + # just echo $language_code.lang or *.php file line if they are updated + svn up | grep -E "$language_code.lang|en.lang|.php" | tee -a "$logfile"_this_run.log + # echo -n "" # debug + else + cd "$svn_directory/" + # just echo $language_code.lang or *.php file line if they are updated + svn co $svn_method${web_pages[$web_page_name]} $web_page_name | grep -E "$language_code.lang|en.lang|.php" | tee -a "$logfile"_this_run.log + echo -n "" | tee -a "$logfile"_this_run.log + cd "$svn_directory/$web_page_name/" + fi + # echo "" | tee -a "$logfile"_this_run.log + done - if [ ! -d "$working_translations_directory/web_pages_lang/en/" ]; then - mkdir -vp "$working_translations_directory/web_pages_lang/en/" | tee -a "$logfile"_this_run.log - fi - cp $copy_options ./web_pages_lang/en/* "$working_translations_directory/web_pages_lang/en/" | tee -a "$logfile"_this_run.log - if [ ! -d "$working_translations_directory/web_pages_lang/$language_code/" ]; then - mkdir -vp "$working_translations_directory/web_pages_lang/$language_code/" | tee -a "$logfile"_this_run.log - fi - cp $copy_options ./web_pages_lang/$language_code/* "$working_translations_directory/web_pages_lang/$language_code/" | tee -a "$logfile"_this_run.log - if [ ! -d "$working_translations_directory/web_page_navigation/" ]; then - mkdir -vp "$working_translations_directory/web_page_navigation/" | tee -a "$logfile"_this_run.log + + #copying the english files and $language_code.lang files for editing in working directory if required + if [ $copying_wp -eq 1 ]; then + echo $separator | tee -a "$logfile"_this_run.log + echo -e "\E[32m" + echo "Web files will be copied (updated) into working translations directory." + echo -e "\E[m" + cd "$svn_directory/" + + if [ ! -d "$working_translations_directory/web_pages_lang/en/" ]; then + mkdir -vp "$working_translations_directory/web_pages_lang/en/" | tee -a "$logfile"_this_run.log + fi + cp $copy_options ./web_pages_lang/en/* "$working_translations_directory/web_pages_lang/en/" | tee -a "$logfile"_this_run.log + if [ ! -d "$working_translations_directory/web_pages_lang/$language_code/" ]; then + mkdir -vp "$working_translations_directory/web_pages_lang/$language_code/" | tee -a "$logfile"_this_run.log + fi + cp $copy_options ./web_pages_lang/$language_code/* "$working_translations_directory/web_pages_lang/$language_code/" | tee -a "$logfile"_this_run.log + if [ ! -d "$working_translations_directory/web_page_navigation/" ]; then + mkdir -vp "$working_translations_directory/web_page_navigation/" | tee -a "$logfile"_this_run.log + fi + cp $copy_options ./web_page_navigation/en.lang "$working_translations_directory/web_page_navigation/" | tee -a "$logfile"_this_run.log + cp $copy_options ./web_page_navigation/$language_code.lang "$working_translations_directory/web_page_navigation/" | tee -a "$logfile"_this_run.log fi - cp $copy_options ./web_page_navigation/en.lang "$working_translations_directory/web_page_navigation/" | tee -a "$logfile"_this_run.log - cp $copy_options ./web_page_navigation/$language_code.lang "$working_translations_directory/web_page_navigation/" | tee -a "$logfile"_this_run.log -fi -if [ -d "$svn_directory/web_page_navigation/" ]; then - if [ -d "$svn_directory/web_page_navigation_2/" ]; then - diff -rq "$svn_directory/web_page_navigation" "$svn_directory/web_page_navigation_2" | grep -E ".lang" | tee -a "$logfile"_this_run.log + if [ -d "$svn_directory/web_page_navigation/" ]; then + if [ -d "$svn_directory/web_page_navigation_2/" ]; then + diff -rq "$svn_directory/web_page_navigation" "$svn_directory/web_page_navigation_2" | grep -E ".lang" | tee -a "$logfile"_this_run.log + else + echo "Both navigation directories ($svn_directory/web_page_navigation and $svn_directory/web_page_navigation_2) are not present. Comparing is not possible." | tee -a "$logfile"_this_run.log + fi else echo "Both navigation directories ($svn_directory/web_page_navigation and $svn_directory/web_page_navigation_2) are not present. Comparing is not possible." | tee -a "$logfile"_this_run.log fi -else - echo "Both navigation directories ($svn_directory/web_page_navigation and $svn_directory/web_page_navigation_2) are not present. Comparing is not possible." | tee -a "$logfile"_this_run.log + echo "" | tee -a "$logfile"_this_run.log fi -echo "" | tee -a "$logfile"_this_run.log cd "$git_directory/" ##################################### TODO START change searching for new *.pot files and other resources in git -- cgit v1.2.1