6 [ $BASEDIR ] || BASEDIR
=$WDIR # root of translatable sources
8 PROJECT
="tagua" # project name
9 BUGADDR
="http://trac.tagua-project.org"
11 echo "Preparing rc files"
13 # we use simple sorting to make sure the lines do not jump around too much from system to system
14 find .
-name '*.rc' -o -name '*.ui' -o -name '*.kcfg' |
sort > ${WDIR}/rcfiles.list
15 xargs --arg-file=${WDIR}/rcfiles.list extractrc
> ${WDIR}/extractedrc.cpp
16 # additional string for KAboutData
17 echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/extractedrc.cpp
18 echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/extractedrc.cpp
20 echo "Done preparing rc files"
23 echo "Extracting messages"
25 # see above on sorting
26 find .
-name '*.cpp' -o -name '*.h' -o -name '*.c' |
sort > ${WDIR}/infiles.list
27 echo "extractedrc.cpp" >> ${WDIR}/infiles.list
29 xgettext
--from-code=UTF-8
-C -kde -ci18n -ki18n:1 -ki18nc:1c
,2 -ki18np:1,2 -ki18ncp:1c
,2,3 -ktr2i18n:1 \
30 -kI18N_NOOP:1 -kI18N_NOOP2:1c
,2 -kaliasLocale -kki18n:1 -kki18nc:1c
,2 -kki18np:1,2 -kki18ncp:1c
,2,3 \
31 --msgid-bugs-address="${BUGADDR}" \
32 --files-from=infiles.list
-D ${SRCDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
33 echo "Done extracting messages"
36 echo "Merging translations"
37 catalogs
=`find translations -name '*.po'`
38 for cat in $catalogs; do
40 msgmerge
-o $cat.new
$cat ${PROJECT}.pot
43 echo "Done merging translations"