aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README7
-rwxr-xr-xcheck_for_translation_work.sh116
2 files changed, 67 insertions, 56 deletions
diff --git a/README b/README
index 05e3cc06..4a5aaf6e 100644
--- a/README
+++ b/README
@@ -1,4 +1,7 @@
NEWS
+2013/11/01
+added option to exclude all work on web pages translation
+
2013/10/31
added support for git NOTE: you need to add git_directory variable in your ~/.mageia-i18n-config file
added creation of list_of_resources_for_translation.txt with statistics
@@ -23,6 +26,7 @@ FEATURES
-creation of working copy of po resource in working directory if required
-testing for differences of *.po file from working copy if required
-testing for differences of *.pot file from working copy if required
+-option to exclude all work on web pages translation
-searching for new *.pot files in svn (TODO also search from git)
INSTALATION AND CONFIGURATION
@@ -36,6 +40,7 @@ Remember to upload your public ssh key to mageia identity! Otherwise the script
See wiki (https://wiki.mageia.org/en/Git_usage_for_l10n_and_doc) for details.
It's recommended that you first try git clone and push without script to test if your setup is as it should be.
Same goes for svn commit if you need it (currently there are only translations for web pages left on svn).
+You can exclude all work on web pages translation with option work_on_web_pages_translation. In that case you don't need to configure svn at all.
At least you need to adjust following setings in configuration file named .mageia-i18n-config that has been made in your home directory on the first run of the script.
@@ -43,7 +48,7 @@ Set this according to your language code:
language_code=sl
Adjust svn, git and working translations directories
-svn_directory= default is /home/user/Mageia/i18n/svn
+svn_directory= default is just a template: /home/user/Mageia/i18n/svn
git_directory="/home/user/Mageia/i18n/git" # added after git transition
working_translations_directory= default is /home/user/Mageia/i18n/translations
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