From bf75aae3c9f6ac2130b65a0499e501ee697688b1 Mon Sep 17 00:00:00 2001 From: Necoro <> Date: Wed, 23 Jan 2008 23:52:02 +0000 Subject: r710@Devoty: necoro | 2008-01-24 00:50:36 +0100 pocompile now takes an optional list of locales to build. this adds linguas support. --- pocompile.sh | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'pocompile.sh') diff --git a/pocompile.sh b/pocompile.sh index 865c380..f25c51e 100755 --- a/pocompile.sh +++ b/pocompile.sh @@ -1,18 +1,32 @@ #!/bin/sh # Helper script to compile all .po files in the i18n directroy into .mo files. -# Copied from porthole :) cd i18n -for ITEM in *.po; do - LANG=${ITEM/.po/} - echo "Creating translation file for ${LANG}." +eme="" +if [ "$1" == "-emerge" ]; then + eme="y" + shift +fi - if [ "$1" == "-emerge" ]; then - mkdir mo -p - msgfmt ${ITEM} -o mo/${LANG}.mo - else - mkdir ${LANG}/LC_MESSAGES -p - msgfmt ${ITEM} -o ${LANG}/LC_MESSAGES/portato.mo +if [ $# -gt 0 ]; then + langs="$@" +else + langs="$(ls *.po | sed 's/\.po//g')" +fi + +for LANG in $langs; do + ITEM=${LANG}.po + + if [ -f $ITEM ]; then + echo "Creating translation file for ${LANG}." + + if [ "$eme"x == "yx" ]; then + mkdir mo -p + msgfmt ${ITEM} -o mo/${LANG}.mo + else + mkdir ${LANG}/LC_MESSAGES -p + msgfmt ${ITEM} -o ${LANG}/LC_MESSAGES/portato.mo + fi fi done -- cgit v1.2.3