Skip to content

Instantly share code, notes, and snippets.

@MattRead
Created August 24, 2011 19:50
Show Gist options
  • Save MattRead/1169013 to your computer and use it in GitHub Desktop.
Save MattRead/1169013 to your computer and use it in GitHub Desktop.
update Habari POT and sync translations to etras-repo
#!/bin/bash
# setup tmp files from tar.gz's
cd /home/matt/habari-locales/bzr/
bzr merge
bzr add locale/*
bzr commit -m "lp sync"
cd ../
# check fo .po
for d in `ls bzr/locale/*.po`;
do
if [[ $d =~ bzr/locale/(.*).po ]]
then
if [ ! -d ${BASH_REMATCH[1]} ]
then
mkdir ${BASH_REMATCH[1]}
mkdir ${BASH_REMATCH[1]}/trunk
mkdir ${BASH_REMATCH[1]}/trunk/LC_MESSAGES
mkdir ${BASH_REMATCH[1]}/trunk/dist
fi
echo "moving ${BASH_REMATCH[1]}.po"
cp bzr/locale/${BASH_REMATCH[1]}.po ${BASH_REMATCH[1]}/trunk/LC_MESSAGES/habari.po
echo "generating mo file"
msgfmt -o ${BASH_REMATCH[1]}/trunk/LC_MESSAGES/habari.mo ${BASH_REMATCH[1]}/trunk/LC_MESSAGES/habari.po
svn add -q ${BASH_REMATCH[1]} ${BASH_REMATCH[1]}/trunk/LC_MESSAGES/habari.po ${BASH_REMATCH[1]}/trunk/LC_MESSAGES/habari.mo
fi
done
# remove tmp files
rm -rf tmp
svn ci -m"launchpad sync"
echo "done!"
#!/bin/bash
cd /home/matt/habari-trunk/
svn up
./rxgettext.sh
svn ci system/locale/habari.pot -m"automatic POT template generation"
xgettext -o locale/habari.pot --no-wrap --add-comments=@locale --language=PHP --from-code=utf-8 --keyword=_n:1,2 --keyword=_ne:1,2 --keyword=_t --keyword=_e $(find . -name "*.php")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment