From ea7aa3167bd190385d99c3fb30ad5b60c37656c6 Mon Sep 17 00:00:00 2001 From: "Jehan-Guillaume (ioguix) de Rorthais" Date: Sat, 21 May 2011 23:06:23 +0200 Subject: [PATCH] Update lang/README file and improve lang2xml script. * checks if given files exists before trying recoding * allows to run lang2xml with no args to build all translations --- lang/README | 8 ++++---- lang/lang2xml | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lang/README b/lang/README index 1292467f..580a1cea 100644 --- a/lang/README +++ b/lang/README @@ -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 (eg. 'french') +./lang2xml (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: diff --git a/lang/lang2xml b/lang/lang2xml index 4a5e6d26..ebe40519 100755 --- a/lang/lang2xml +++ b/lang/lang2xml @@ -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) -- 2.39.5