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