Subversion Repositories public

Rev

Rev 251 | Details | Compare with Previous | Last modification | View Log | RSS feed

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