~ubuntu-branches/ubuntu/precise/partitionmanager/precise

« back to all changes in this revision

Viewing changes to src/kpart/test/po/messages.sh

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2009-05-02 14:50:18 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090502145018-ktgdpdforvzltn86
Tags: 1.0.0~beta2-0ubuntu1
* New upstream release
* Remove debian/patches (icon is now included)
  + drop quilt build-dep
* Bump standards-version to 3.8.1
* Update lintian override with manpage for partitionmanager-bin, the 
  actually binary is now a wrapper around -bin, so we don't need an
  additional manpage
* Use pkg-kde-tools for building instead of CDBS' kde4.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
BASEDIR=".." # root of translatable sources
 
4
PROJECT="kparttest" # project name
 
5
BUGADDR="http://sourceforge.net/tracker/?group_id=50231&atid=459007" # MSGID-Bugs
 
6
WDIR=`pwd` # working dir
 
7
EXTRACTRC="/usr/lib/kde4/bin/extractrc" # path to KDE4 extractrc (the KDE3 version silently fails)
 
8
 
 
9
echo "Preparing rc files"
 
10
cd ${BASEDIR}
 
11
 
 
12
# we use simple sorting to make sure the lines do not jump around too much from system to system
 
13
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
 
14
 
 
15
xargs --arg-file=${WDIR}/rcfiles.list ${EXTRACTRC} > ${WDIR}/rc.cpp
 
16
# additional string for KAboutData
 
17
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
 
18
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
 
19
cd ${WDIR}
 
20
echo "Done preparing rc files"
 
21
 
 
22
 
 
23
echo "Extracting messages"
 
24
cd ${BASEDIR}
 
25
# see above on sorting
 
26
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
 
27
echo "rc.cpp" >> ${WDIR}/infiles.list
 
28
cd ${WDIR}
 
29
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
 
30
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
 
31
--msgid-bugs-address="${BUGADDR}" \
 
32
--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
 
33
echo "Done extracting messages"
 
34
 
 
35
echo "Merging translations"
 
36
catalogs=`find . -name '*.po'`
 
37
for cat in $catalogs; do
 
38
    echo $cat
 
39
    msgmerge -o $cat.new $cat ${PROJECT}.pot
 
40
    mv $cat.new $cat
 
41
done
 
42
echo "Done merging translations"
 
43
 
 
44
echo "Cleaning up"
 
45
cd ${WDIR}
 
46
rm rcfiles.list
 
47
rm infiles.list
 
48
rm rc.cpp
 
49
echo "Done"
 
50