joachim99@81: # Copyright (C) 2008 by Joachim Eibl joachim99@81: # Licence: GPL V2 joachim99@81: # GNU GENERAL PUBLIC LICENSE, Version 2, June 1991 joachim99@81: # This program is free software; you can redistribute it and/or modify joachim99@81: # it under the terms of the GNU General Public License as published by joachim99@81: # the Free Software Foundation; either version 2 of the License, or joachim99@81: # (at your option) any later version. joachim99@81: # joachim99@81: # This program is distributed in the hope that it will be useful, joachim99@81: # but WITHOUT ANY WARRANTY; without even the implied warranty of joachim99@81: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the joachim99@81: # GNU General Public License for more details. joachim99@81: # joachim99@81: # You should have received a copy of the GNU General Public License joachim99@81: # along with this program; if not, write to the Free Software joachim99@81: # Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307 USA joachim99@81: # joachim99@81: # For details see file "COPYING". joachim99@81: joachim99@81: # update_po_dir: joachim99@81: # automatically fetch the most recent translations from the websvn.kde.org server joachim99@81: # and update all files for translations joachim99@81: # Requirements: wget, gettext-tools, qt3-devel-tools joachim99@81: joachim99@81: # extract extra strings joachim99@81: xgettext --keyword=i18n --keyword=I18N_NOOP -C ../src-QT4/kreplacements/kreplacements.cpp -o kreplacements.pot joachim99@81: sed -i /add_subdirectory/d CMakeLists.txt joachim99@81: wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/subdirs joachim99@81: for i in `cat subdirs` ; do joachim99@81: # Many languages don't have translations so don't worry about errors too much. joachim99@81: wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$i/messages/extragear-utils/kdiff3.po -O $i.po joachim99@81: # if file exists and has size greater than zero joachim99@81: if [ $i != "x-test" -a -s $i.po ]; then joachim99@81: echo $i joachim99@81: # if directory exists delete it recursively and recreate it joachim99@81: if [ -d $i ]; then joachim99@81: rm -R $i joachim99@81: fi joachim99@81: mkdir $i joachim99@81: cp $i.po $i/kdiff3.po joachim99@81: sed s/xx/$i/ CMakeLists_xx.txt >$i/CMakeLists.txt joachim99@81: joachim99@81: # Same for the kdiff3plugin.po-file joachim99@81: wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$i/messages/extragear-utils/kdiff3plugin.po -O kdiff3plugin_$i.po joachim99@81: if [ -s kdiff3plugin_$i.po ]; then joachim99@81: cp kdiff3plugin_$i.po $i/kdiff3plugin.po joachim99@81: fi joachim99@81: rm kdiff3plugin_$i.po joachim99@81: joachim99@81: # Create qm-files joachim99@81: # The qm files are only needed for the qt-only version, not for the KDE-version. joachim99@81: wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$i/messages/kdelibs/kdelibs4.po -O kdelibs_$i.po joachim99@81: # (msgmerge and msgcat are from "gettext-tools"-package.) joachim99@81: msgmerge --no-fuzzy-matching kdelibs_$i.po kreplacements.pot >kreplacements_$i.po joachim99@81: msgcat --use-first $i.po kreplacements_$i.po >kdiff3_$i.po joachim99@81: # (msg2qm is from "qt3-devel-tools"-package.) joachim99@81: /usr/lib/qt3/bin/msg2qm kdiff3_$i.po kdiff3_$i.qm joachim99@81: rm kdelibs_$i.po kdiff3_$i.po kreplacements_$i.po joachim99@81: echo add_subdirectory\($i\) >>CMakeLists.txt joachim99@81: fi joachim99@81: rm $i.po joachim99@81: done joachim99@81: joachim99@81: # Print some info joachim99@81: echo Translated items per language: joachim99@81: for i in `cat subdirs` ; do joachim99@81: if [ -s $i/kdiff3.po ]; then joachim99@81: echo $i `grep msgstr $i/kdiff3.po | grep -v \"\" | wc -l` joachim99@81: fi joachim99@81: done joachim99@81: joachim99@81: rm subdirs joachim99@81: rm kreplacements.pot joachim99@81: