Implement ActionList::Entry#clear.
[kaya.git] / i18n.sh
blob4f3b655d6d78f1e69e52c887466abf84fb44d788
1 #!/bin/sh
2 PROJECT="kaya" # project name
3 BUGADDR="http://github.com/pcapriotti/kaya/issues"
4 WDIR=`pwd` # working dir
5 BASEDIR=${WDIR} # root of translatable sources
7 echo "Preparing rc files"
8 cd ${BASEDIR}
9 # we use simple sorting to make sure the lines do not jump around too much from system to system
10 find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
11 xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
12 cd ${WDIR}
13 echo "Done preparing rc files"
15 echo "Extracting messages"
16 cd ${BASEDIR}
17 # see above on sorting
18 find . -name '*.rb' | sort > ${WDIR}/infiles.list
19 echo "rc.cpp" >> ${WDIR}/infiles.list
20 cd ${WDIR}
21 xgettext --from-code=UTF-8 -L python -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
22 -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
23 --msgid-bugs-address="${BUGADDR}" \
24 --files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
25 echo "Done extracting messages"
27 echo "Merging translations"
28 catalogs=`find . -name '*.po'`
29 for cat in $catalogs; do
30 echo $cat
31 msgmerge -o $cat.new $cat ${PROJECT}.pot
32 mv $cat.new $cat
33 done
34 echo "Done merging translations"
37 echo "Cleaning up"
38 cd ${WDIR}
39 rm rcfiles.list
40 rm infiles.list
41 rm rc.cpp