Add some l10n stuff to the kpart test app so we can see if l10n works in the kpart

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=957970
This commit is contained in:
Volker Lanz 2009-04-23 07:52:43 +00:00
parent 18a374e43a
commit 6f3059ba46
5 changed files with 153 additions and 0 deletions

View File

@ -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})

View File

@ -0,0 +1,21 @@
# Copyright (C) 2008 by Volker Lanz <vl@fidra.de>
#
# 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})

40
src/kpart/test/po/de.po Normal file
View File

@ -0,0 +1,40 @@
# Copyright (C) 2009
# This file is distributed under the same license as the kparttest package.
#
# Volker Lanz <vl@fidra.de>, 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 <vl@fidra.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\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"

View File

@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

50
src/kpart/test/po/messages.sh Executable file
View File

@ -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"