annotate kdiff3/po/update_po_dir @ 113:7bca1f1340f6 tip

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