2 BASEDIR
="./" # root of translatable sources
3 PROJECT
="kworship" # project name
4 BUGADDR
="bugs.kworship.org" # MSGID-Bugs
5 WDIR
=`pwd` # working dir
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
12 # additional string for KAboutData
13 echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
14 echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
16 echo "Done preparing rc files"
19 echo "Extracting messages"
21 # see above on sorting
22 find .
-name '*.cpp' -o -name '*.h' -o -name '*.c' |
sort > ${WDIR}/infiles.list
23 echo "rc.cpp" >> ${WDIR}/infiles.list
25 xgettext
--from-code=UTF-8
-C -kde -ci18n -ki18n:1 -ki18nc:1c
,2 -ki18np:1,2 -ki18ncp:1c
,2,3 -ktr2i18n:1 \
26 -kI18N_NOOP:1 -kI18N_NOOP2:1c
,2 -kaliasLocale -kki18n:1 -kki18nc:1c
,2 -kki18np:1,2 -kki18ncp:1c
,2,3 \
27 --msgid-bugs-address="${BUGADDR}" \
28 --files-from=infiles.list
-D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
29 echo "Done extracting messages"
32 echo "Merging translations"
33 catalogs
=`find . -name '*.po'`
34 for cat in $catalogs; do
36 msgmerge
--previous -o $cat.new
$cat ${PROJECT}.pot
39 echo "Done merging translations"