diff --git a/src/kpart/test/CMakeLists.txt b/src/kpart/test/CMakeLists.txt index 6ac0a29..ae7f360 100644 --- a/src/kpart/test/CMakeLists.txt +++ b/src/kpart/test/CMakeLists.txt @@ -24,6 +24,8 @@ set(kparttest_SRCS kparttest.cpp ) +add_subdirectory(po) + kde4_add_executable(kparttest ${kparttest_SRCS}) target_link_libraries(kparttest ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS}) diff --git a/src/kpart/test/po/CMakeLists.txt b/src/kpart/test/po/CMakeLists.txt new file mode 100644 index 0000000..63b5f28 --- /dev/null +++ b/src/kpart/test/po/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (C) 2008 by Volker Lanz +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +FILE(GLOB PO_FILES *.po) + +ADD_TRANSLATIONS(kparttest ${PO_FILES}) + diff --git a/src/kpart/test/po/de.po b/src/kpart/test/po/de.po new file mode 100644 index 0000000..ebc2d37 --- /dev/null +++ b/src/kpart/test/po/de.po @@ -0,0 +1,40 @@ +# Copyright (C) 2009 +# This file is distributed under the same license as the kparttest package. +# +# Volker Lanz , 2009. +msgid "" +msgstr "" +"Project-Id-Version: kparttest_de\n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?group_id=50231&atid=459007\n" +"POT-Creation-Date: 2009-04-23 09:37+0200\n" +"PO-Revision-Date: 2009-04-23 09:38+0200\n" +"Last-Translator: Volker Lanz \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 0.3\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: main.cpp:31 +msgid "KDE Partition Manager KPart" +msgstr "" + +#: main.cpp:32 +msgid "A test application for KDE Partition Manager's KPart." +msgstr "Eine Testanwendung für den KPart vom KDE Partitionsmanager." + +#: main.cpp:34 +msgid "Copyright (c) 2008 Volker Lanz" +msgstr "" + +#: rc.cpp:1 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "Volker Lanz" + +#: rc.cpp:2 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "vl@fidra.de" + diff --git a/src/kpart/test/po/kparttest.pot b/src/kpart/test/po/kparttest.pot new file mode 100644 index 0000000..8124483 --- /dev/null +++ b/src/kpart/test/po/kparttest.pot @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" +"group_id=50231&atid=459007\n" +"POT-Creation-Date: 2009-04-23 09:37+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.cpp:31 +msgid "KDE Partition Manager KPart" +msgstr "" + +#: main.cpp:32 +msgid "A test application for KDE Partition Manager's KPart." +msgstr "" + +#: main.cpp:34 +msgid "Copyright (c) 2008 Volker Lanz" +msgstr "" + +#: rc.cpp:1 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "" + +#: rc.cpp:2 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "" diff --git a/src/kpart/test/po/messages.sh b/src/kpart/test/po/messages.sh new file mode 100755 index 0000000..f44169c --- /dev/null +++ b/src/kpart/test/po/messages.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +BASEDIR=".." # root of translatable sources +PROJECT="kparttest" # project name +BUGADDR="http://sourceforge.net/tracker/?group_id=50231&atid=459007" # MSGID-Bugs +WDIR=`pwd` # working dir +EXTRACTRC="/usr/lib/kde4/bin/extractrc" # path to KDE4 extractrc (the KDE3 version silently fails) + +echo "Preparing rc files" +cd ${BASEDIR} + +# we use simple sorting to make sure the lines do not jump around too much from system to system +find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list + +xargs --arg-file=${WDIR}/rcfiles.list ${EXTRACTRC} > ${WDIR}/rc.cpp +# additional string for KAboutData +echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp +echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp +cd ${WDIR} +echo "Done preparing rc files" + + +echo "Extracting messages" +cd ${BASEDIR} +# see above on sorting +find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list +echo "rc.cpp" >> ${WDIR}/infiles.list +cd ${WDIR} +xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \ +-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ +--msgid-bugs-address="${BUGADDR}" \ +--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; } +echo "Done extracting messages" + +echo "Merging translations" +catalogs=`find . -name '*.po'` +for cat in $catalogs; do + echo $cat + msgmerge -o $cat.new $cat ${PROJECT}.pot + mv $cat.new $cat +done +echo "Done merging translations" + +echo "Cleaning up" +cd ${WDIR} +rm rcfiles.list +rm infiles.list +rm rc.cpp +echo "Done" +