3
# Inspired by Makefile.common from coolo
4
# this script is used to update the .po files
6
# To update the translations, you will need a specific gettext
7
# patched for kde and a lot of patience, tenacity, luck, time ..
10
# I guess one should only update the .po files when all .cpp files
11
# are generated (after a make or scons)
13
# If you have a better way to do this, do not keep that info
14
# for yourself and help me to improve this script, thanks
15
# (tnagyemail-mail tat yahoo d0tt fr)
17
SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code
18
TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips
20
KDEDIR=`kde-config --prefix`
22
KDEPOT=`kde-config --prefix`/include/kde.pot
23
XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT "
25
## check that kde.pot is available
26
if ! test -e $KDEPOT; then
27
echo "$KDEPOT does not exist, there is something wrong with your installation!"
28
XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale "
33
## extract the strings
34
echo "extracting the strings"
36
# process the .ui and .rc files
37
$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp
38
$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp
39
echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp
41
# process the tips - $SRCDIR is supposed to be where the tips are living
42
pushd $TIPSDIR; preparetips >tips.cpp; popd
44
$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot
46
# remove the intermediate files
47
rm -f $TIPSDIR/tips.cpp
49
rm -f $SRCDIR/_translatorinfo.cpp
51
## now merge the .po files ..
52
echo "merging the .po files"
54
for i in `ls *.po`; do
55
msgmerge $i kdissert.pot -o $i || exit 1