Update lang/README file and improve lang2xml script.
authorJehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com>
Sat, 21 May 2011 21:06:23 +0000 (23:06 +0200)
committerJehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com>
Sat, 21 May 2011 21:06:23 +0000 (23:06 +0200)
  * checks if given files exists before trying recoding
* allows to run lang2xml with no args to build all translations

lang/README
lang/lang2xml

index 1292467fc4ff7739cd23e1bbbfc7860cc83f93f3..580a1cea77592d152a1295ce5996a77536cb23b3 100644 (file)
@@ -3,19 +3,19 @@ Translators
 
 Please read the TRANSLATORS file in the top directory.
 
-This directory contains the HTML Unicode recodings of the source
+"recoded" directory contains the HTML Unicode recodings of the source
 language files.  These are the actual files used by phpPgAdmin
 when displaying strings.
 
 Instructions on recoding:
 
 cd lang
-make <language>  (eg. 'french')
+./lang2xml <language_file>  (eg. 'french.php')
 
-Running make with no arguments will recode all language files:
+Running lang2xml with no arguments will recode all language files:
 
 cd lang
-make
+lang2xml
 
 To check your translation:
 
index 4a5e6d269032f2f4a68b82131232c46e2d8b42a6..ebe405190eb76bde458330144419d884d3382fce 100755 (executable)
@@ -31,6 +31,7 @@ function prepare () {
 function rec () {
        for f in $@
        do
+               [ ! -f $f ] && echo "$f is not a valid file." && continue
                DIRNAME=$(dirname $f)
                mkdir -p $DIRNAME
                echo "Recoding $f..."
@@ -50,7 +51,10 @@ function clean () {
 
 prepare
 
-case $1 in
+COMMAND=$1
+[ -z "$COMMAND" ] && COMMAND="all"
+
+case $COMMAND in
        all)
                # find all translation files in the source tree
                TARGETS=$(ls *.php | grep -v translations.php)