summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/kscons_tdemdi/messages.sh
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-26 13:18:13 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-26 13:18:13 -0600
commit2fb700f92bb787fab0845a63a541cd5640daa449 (patch)
treec6f769db55585dd47a9fd415a40ee8b86926f683 /languages/cpp/app_templates/kscons_tdemdi/messages.sh
parentfd1d1e1064eb09ddbbd67d3597c39856f5c0bc76 (diff)
downloadtdevelop-2fb700f92bb787fab0845a63a541cd5640daa449.tar.gz
tdevelop-2fb700f92bb787fab0845a63a541cd5640daa449.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'languages/cpp/app_templates/kscons_tdemdi/messages.sh')
-rwxr-xr-xlanguages/cpp/app_templates/kscons_tdemdi/messages.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kscons_tdemdi/messages.sh b/languages/cpp/app_templates/kscons_tdemdi/messages.sh
new file mode 100755
index 00000000..a0ce678a
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_tdemdi/messages.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Inspired by Makefile.common from coolo
+# this script is used to update the .po files
+
+# To update the translations, you will need a specific gettext
+# patched for kde and a lot of patience, tenacity, luck, time ..
+
+
+# I guess one should only update the .po files when all .cpp files
+# are generated (after a make or scons)
+
+# If you have a better way to do this, do not keep that info
+# for yourself and help me to improve this script, thanks
+# (tnagyemail-mail tat yahoo d0tt fr)
+
+SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code
+TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips
+
+TDEDIR=`tde-config --prefix`
+EXTRACTRC=extractrc
+TDEPOT=`tde-config --prefix`/include/kde.pot
+XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $TDEPOT "
+
+## check that kde.pot is available
+if ! test -e $TDEPOT; then
+ echo "$TDEPOT does not exist, there is something wrong with your installation!"
+ XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale "
+fi
+
+> rc.cpp
+
+## extract the strings
+echo "extracting the strings"
+
+# process the .ui and .rc files
+$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp
+$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp
+echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp
+
+# process the tips - $SRCDIR is supposed to be where the tips are living
+pushd $TIPSDIR; preparetips >tips.cpp; popd
+
+$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot
+
+# remove the intermediate files
+rm -f $TIPSDIR/tips.cpp
+rm -f rc.cpp
+rm -f $SRCDIR/_translatorinfo.cpp
+
+## now merge the .po files ..
+echo "merging the .po files"
+
+for i in `ls *.po`; do
+ msgmerge $i kdissert.pot -o $i || exit 1
+done
+
+## finished
+echo "Done"
+