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"
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
13 echo "Done preparing rc files"
15 echo "Extracting messages"
17 # see above on sorting
18 find .
-name '*.rb' |
sort > ${WDIR}/infiles.list
19 echo "rc.cpp" >> ${WDIR}/infiles.list
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
31 msgmerge
-o $cat.new
$cat ${PROJECT}.pot
34 echo "Done merging translations"