From b6d5e365f5580d05eff43ff9b2934bb2e1301244 Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel <lloyd@hilaiel.com> Date: Thu, 5 Jul 2012 13:01:14 -0600 Subject: [PATCH] fix debugging locale - allow the template to not specify a charset properly - and don't msgmerge db_LB, it's regenereated afresh each time --- scripts/merge_po.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/merge_po.sh b/scripts/merge_po.sh index 139ab5074..626e6ec94 100755 --- a/scripts/merge_po.sh +++ b/scripts/merge_po.sh @@ -12,7 +12,7 @@ function usage() { # check if file and dir are there if [[ ($# -ne 1) || (! -d "$1") ]]; then usage; fi -for lang in `find $1 -type f -name "*.po"`; do +for lang in `find $1 -type f -name "*.po" -not -path '*/db_LB/*'`; do dir=`dirname $lang` stem=`basename $lang .po` msgmerge -o ${dir}/${stem}.po.tmp ${dir}/${stem}.po $1/templates/LC_MESSAGES/${stem}.pot @@ -21,12 +21,22 @@ done # Optionally auto-localize our test locale db-LB if hash podebug >/dev/null; then + + # our debug locale has a tendency to be characterized as 'CHARSET' rather than + # UTF-8, this hack works around the problem. + # see issue #1054 + for file in locale/templates/LC_MESSAGES/*.pot ; do + mv $file $file.old + sed 's/CHARSET/UTF-8/g' $file.old > $file + rm -f $file.old + done + for catalog in messages client; do - + echo "Translating ${catalog}.po" podebug --rewrite=flipped -i locale/templates/LC_MESSAGES/${catalog}.pot\ -o locale/db_LB/LC_MESSAGES/${catalog}.po - done + done else echo 'Skipping db-LB, install translate-toolkit if you want to have that up-to-date.' fi -- GitLab