~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/app_templates/kscons_kxt/messages.sh

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Inspired by Makefile.common from coolo
 
4
# this script is used to update the .po files
 
5
 
 
6
# To update the translations, you will need a specific gettext 
 
7
# patched for kde and a lot of patience, tenacity, luck, time ..
 
8
 
 
9
 
 
10
# I guess one should only update the .po files when all .cpp files 
 
11
# are generated (after a make or scons)
 
12
 
 
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)
 
16
 
 
17
SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code
 
18
TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips
 
19
 
 
20
KDEDIR=`kde-config --prefix`
 
21
EXTRACTRC=extractrc
 
22
KDEPOT=`kde-config --prefix`/include/kde.pot
 
23
XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT "
 
24
 
 
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 "
 
29
fi
 
30
 
 
31
> rc.cpp
 
32
 
 
33
## extract the strings
 
34
echo "extracting the strings"
 
35
 
 
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
 
40
 
 
41
# process the tips - $SRCDIR is supposed to be where the tips are living
 
42
pushd $TIPSDIR; preparetips >tips.cpp; popd
 
43
 
 
44
$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot
 
45
 
 
46
# remove the intermediate files
 
47
rm -f $TIPSDIR/tips.cpp
 
48
rm -f rc.cpp
 
49
rm -f $SRCDIR/_translatorinfo.cpp
 
50
 
 
51
## now merge the .po files ..
 
52
echo "merging the .po files"
 
53
 
 
54
for i in `ls *.po`; do
 
55
    msgmerge $i kdissert.pot -o $i || exit 1
 
56
done
 
57
 
 
58
## finished
 
59
echo "Done"
 
60