From b89717ac05a9c715a68ba7ce3c3267be2fcdc1a4 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 27 Nov 2014 21:31:09 +0100 Subject: script updated to fix dash expand problem in some langs --- tools/rebuild_gettext_catalogs.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tools/rebuild_gettext_catalogs.sh') diff --git a/tools/rebuild_gettext_catalogs.sh b/tools/rebuild_gettext_catalogs.sh index 1c7b9e34e..4e84cac2d 100755 --- a/tools/rebuild_gettext_catalogs.sh +++ b/tools/rebuild_gettext_catalogs.sh @@ -22,14 +22,14 @@ do else path_and_filename=./langs/en/$resource fi - if [ -f $path_and_filename.pot ]; then # do a temporary copy + if [ -f "$path_and_filename.pot" ]; then # do a temporary copy cp $path_and_filename.pot $path_and_filename.copy fi php_source=${resources[$resource]} php tools/extract2gettext.php "$php_source" $resource true php_error_level=$? # catch php error level errors[$php_source]=$php_error_level - if [ -f $path_and_filename.pot ]; then + if [ -f "$path_and_filename.pot" ]; then # msgmerge check of generated pot file msgmerge --quiet --no-wrap $path_and_filename.pot $path_and_filename.pot --output-file=$path_and_filename.tmp msgmerge_error_level=$? # catch msgmerge error level @@ -37,7 +37,7 @@ do errors[$php_source]=$msgmerge_error_level rm $path_and_filename.tmp fi - if [ -f $path_and_filename.copy ] && [ -f $path_and_filename.tmp ]; then + if [ -f "$path_and_filename.copy" ] && [ -f "$path_and_filename.tmp" ]; then diff --ignore-matching-lines='^"POT-Creation-Date:' $path_and_filename.tmp $path_and_filename.copy if [ $? -eq 1 ]; then # there are differences errors[$php_source]=0 @@ -51,14 +51,14 @@ do difference=none fi else # diff not possible - if [ -f $path_and_filename.tmp ]; then + if [ -f "$path_and_filename.tmp" ]; then mv $path_and_filename.tmp $path_and_filename.pot - if [ -f $path_and_filename.copy ]; then + if [ -f "$path_and_filename.copy" ]; then rm $path_and_filename.copy fi else rm $path_and_filename.pot - if [ -f $path_and_filename.copy ]; then + if [ -f "$path_and_filename.copy" ]; then mv $path_and_filename.copy $path_and_filename.pot difference=none fi @@ -87,7 +87,7 @@ do if [ $msgmerge_error_level -gt 0 ]; then errors[$directory/$resource]=60 echo "$directory"/$resource.po could not be created succesfully - if [ -f $tr_file.tmp ]; then + if [ -f "$tr_file.tmp" ]; then rm $tr_file.tmp fi else @@ -100,9 +100,9 @@ do for directory in ./langs/* do # in each language directory except source - if [ -d $directory/ ] && [ $directory != ./langs/en ]; then + if [ -d "$directory/" ] && [ $directory != ./langs/en ]; then # create po file if needed from lang file if available - if [ ! -f $directory/$resource.po ] && [ -f $directory/$resource.*.lang ]; then + if [ ! -f "$directory/$resource.po" ] && [ -f "$directory/$resource.*.lang" ]; then # echo $directory # usefull for debuging of non UTF-8 files or other python errors python tools/translated_converter.py --filename $directory/$resource python_error_level=$? # catch python error level @@ -110,7 +110,7 @@ do errors[$directory/$resource]=50 fi fi - if [ -f $directory/$resource.po ] && [ -z $difference ]; then # update po file if it exists + if [ -f "$directory/$resource.po" ] && [ -z $difference ]; then # update po file if it exists # msgfmt --statistics --verbose -c $directory/$resource.po -o /dev/null # usefull for debuging (msgctxt "/web/en/ or msgctxt "en/) echo merging $directory/$resource.po msgmerge --quiet --no-wrap $directory/$resource.po ./langs/en/$resource.pot --output-file=$directory/$resource.tmp @@ -118,7 +118,7 @@ do if [ $msgmerge_error_level -gt 0 ]; then errors[$directory/$resource]=60 echo "$directory"/$resource.po could not be created succesfully - if [ -f $tr_file.tmp ]; then + if [ -f "$tr_file.tmp" ]; then rm $directory/$resource.tmp fi else -- cgit v1.2.1