comparison kdiff3/po/update_po_dir @ 81:5d7e91c44e6d

New files.
author joachim99
date Tue, 06 Jan 2009 18:01:57 +0000
parents
children
comparison
equal deleted inserted replaced
80:fcd146072e0c 81:5d7e91c44e6d
1 # Copyright (C) 2008 by Joachim Eibl
2 # Licence: GPL V2
3 # GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307 USA
17 #
18 # For details see file "COPYING".
19
20 # update_po_dir:
21 # automatically fetch the most recent translations from the websvn.kde.org server
22 # and update all files for translations
23 # Requirements: wget, gettext-tools, qt3-devel-tools
24
25 # extract extra strings
26 xgettext --keyword=i18n --keyword=I18N_NOOP -C ../src-QT4/kreplacements/kreplacements.cpp -o kreplacements.pot
27 sed -i /add_subdirectory/d CMakeLists.txt
28 wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/subdirs
29 for i in `cat subdirs` ; do
30 # Many languages don't have translations so don't worry about errors too much.
31 wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$i/messages/extragear-utils/kdiff3.po -O $i.po
32 # if file exists and has size greater than zero
33 if [ $i != "x-test" -a -s $i.po ]; then
34 echo $i
35 # if directory exists delete it recursively and recreate it
36 if [ -d $i ]; then
37 rm -R $i
38 fi
39 mkdir $i
40 cp $i.po $i/kdiff3.po
41 sed s/xx/$i/ CMakeLists_xx.txt >$i/CMakeLists.txt
42
43 # Same for the kdiff3plugin.po-file
44 wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$i/messages/extragear-utils/kdiff3plugin.po -O kdiff3plugin_$i.po
45 if [ -s kdiff3plugin_$i.po ]; then
46 cp kdiff3plugin_$i.po $i/kdiff3plugin.po
47 fi
48 rm kdiff3plugin_$i.po
49
50 # Create qm-files
51 # The qm files are only needed for the qt-only version, not for the KDE-version.
52 wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$i/messages/kdelibs/kdelibs4.po -O kdelibs_$i.po
53 # (msgmerge and msgcat are from "gettext-tools"-package.)
54 msgmerge --no-fuzzy-matching kdelibs_$i.po kreplacements.pot >kreplacements_$i.po
55 msgcat --use-first $i.po kreplacements_$i.po >kdiff3_$i.po
56 # (msg2qm is from "qt3-devel-tools"-package.)
57 /usr/lib/qt3/bin/msg2qm kdiff3_$i.po kdiff3_$i.qm
58 rm kdelibs_$i.po kdiff3_$i.po kreplacements_$i.po
59 echo add_subdirectory\($i\) >>CMakeLists.txt
60 fi
61 rm $i.po
62 done
63
64 # Print some info
65 echo Translated items per language:
66 for i in `cat subdirs` ; do
67 if [ -s $i/kdiff3.po ]; then
68 echo $i `grep msgstr $i/kdiff3.po | grep -v \"\" | wc -l`
69 fi
70 done
71
72 rm subdirs
73 rm kreplacements.pot
74