summaryrefslogtreecommitdiff
path: root/pocompile.sh
diff options
context:
space:
mode:
authorNecoro <>2008-01-23 23:52:02 +0000
committerNecoro <>2008-01-23 23:52:02 +0000
commitbf75aae3c9f6ac2130b65a0499e501ee697688b1 (patch)
tree18db012f173740b38fd262f66f37440f0bf0e107 /pocompile.sh
parentfceb850b55ddf4109905ec939f1e8d06ee651f92 (diff)
downloadportato-bf75aae3c9f6ac2130b65a0499e501ee697688b1.tar.gz
portato-bf75aae3c9f6ac2130b65a0499e501ee697688b1.tar.bz2
portato-bf75aae3c9f6ac2130b65a0499e501ee697688b1.zip
r710@Devoty: necoro | 2008-01-24 00:50:36 +0100
pocompile now takes an optional list of locales to build. this adds linguas support.
Diffstat (limited to '')
-rwxr-xr-xpocompile.sh34
1 files changed, 24 insertions, 10 deletions
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