From fafd016bae496c27e054e43dac0d1e539c73c945 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Fri, 31 Jul 2009 21:13:37 +0000 Subject: [PATCH] german translation for galleryfunctions.php (addresses #43) * add Makefile to generate gettext .pot, .po and .mo files * mark translatable texts in galleryfunctions.php --- Makefile | 26 ++++++++++++++++++++++++++ includes/galleryfunctions.php | 7 ++++--- locale/de/LC_MESSAGES/sjqg.mo | Bin 0 -> 560 bytes locale/de/LC_MESSAGES/sjqg.po | 30 ++++++++++++++++++++++++++++++ locale/sjqg.pot | 31 +++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 locale/de/LC_MESSAGES/sjqg.mo create mode 100644 locale/de/LC_MESSAGES/sjqg.po create mode 100644 locale/sjqg.pot diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6473726 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +OBJECTS = *.php includes/*.php themes/*/*.php dummy/*.php +LANGUAGES = de +TARGETFILES = $(foreach lang,$(LANGUAGES),locale/$(lang)/LC_MESSAGES/sjqg.mo) +POFILES = + +all: $(TARGETFILES) $(POFILES) + +%.mo: %.po + msgfmt $< -o $@ + +%.po: locale/sjqg.pot + if [ ! -d `dirname "$@"` ]; then mkdir -p `dirname "$@"`; fi + if [ -f $@ ]; then \ + msgmerge -U $@ $<; \ + else \ + cp $< $@; \ + fi + +locale/sjqg.pot: $(OBJECTS) + xgettext -d sjqg -o sjqg.pot -p locale \ + --from-code=UTF8 --sort-output \ + --copyright-holder='Jan Dittberner ' \ + --package-name='SJQG' --package-version='0.3' \ + --language=PHP $(OBJECTS) + +.SECONDARY: diff --git a/includes/galleryfunctions.php b/includes/galleryfunctions.php index 1b98bcd..bd439a6 100644 --- a/includes/galleryfunctions.php +++ b/includes/galleryfunctions.php @@ -40,7 +40,7 @@ $basedir = realpath(implode(DIRECTORY_SEPARATOR, array(dirname(__file__), '..')) $inifile = implode(DIRECTORY_SEPARATOR, array($basedir, 'gallery.ini')); if (!file_exists($inifile)) { - die("required $inifile not found."); + die(sprintf(_("required %s not found."), $inifile)); } $configuration = parse_ini_file($inifile); if (array_key_exists('logfile', $configuration)) { @@ -273,7 +273,7 @@ function getScaledImage($galleryname, $basename, $maxdim, $scaletype) { default: header('Content-Type: text/plain'); debug_print_backtrace(); - die('Unknown scaletype'); + die(_('Unknown scale type')); } if ($scaleheight) { @@ -287,7 +287,8 @@ function getScaledImage($galleryname, $basename, $maxdim, $scaletype) { // versuchen das Thumbnail-Verzeichnis anzulegen $mkdir = @mkdir($scaleddirpath, 0755); if (!$mkdir) { - trigger_error("could not create directory $scaleddirpath.\n", + trigger_error(sprintf(_("could not create directory %s.\n"), + $scaleddirpath), E_USER_WARNING); return $galleryname . '/' . $basename; } diff --git a/locale/de/LC_MESSAGES/sjqg.mo b/locale/de/LC_MESSAGES/sjqg.mo new file mode 100644 index 0000000000000000000000000000000000000000..623a2f760b3473d7917dde9f0abb17fffd7f4b93 GIT binary patch literal 560 zcmaKoJ5C%y5QZBYCljt@0%XgT5LrE*WdmT05#nWmS@BvNk@U{g4$Y3Lm+l_(heUACpn$$9et-P?Ip)NaX#vPsBEb> znkwjl%PBcL80gJ*3DkNEyK-90vK5^z>0Xx>dwI9}IYS3ReaydXJM~rFz6nteypd2F zT%6OM5!$jb4%rKPTD>r`UOvB5D-Y4x;t?#zw|WA>=A1SF literal 0 HcmV?d00001 diff --git a/locale/de/LC_MESSAGES/sjqg.po b/locale/de/LC_MESSAGES/sjqg.po new file mode 100644 index 0000000..89e8ad4 --- /dev/null +++ b/locale/de/LC_MESSAGES/sjqg.po @@ -0,0 +1,30 @@ +# German translation for SJQG +# Copyright (C) 2009 Jan Dittberner +# This file is distributed under the same license as the +# scrollingJqueryGallery package. +# Jan Dittberner , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: SJQG 0.3\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-07-31 23:11+0200\n" +"PO-Revision-Date: 2009-07-31 23:11+0200\n" +"Last-Translator: Jan Dittberner \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: includes/galleryfunctions.php:276 +msgid "Unknown scale type" +msgstr "Unbekannter Skalierungstyp" + +#: includes/galleryfunctions.php:290 +#, php-format +msgid "could not create directory %s.\n" +msgstr "Konnte Verzeichnis %s nicht anlegen.\n" + +#: includes/galleryfunctions.php:43 +#, php-format +msgid "required %s not found." +msgstr "benötigte %s nicht gefunden." diff --git a/locale/sjqg.pot b/locale/sjqg.pot new file mode 100644 index 0000000..e436c9d --- /dev/null +++ b/locale/sjqg.pot @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Jan Dittberner +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SJQG 0.3\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-07-31 23:11+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" + +#: includes/galleryfunctions.php:276 +msgid "Unknown scale type" +msgstr "" + +#: includes/galleryfunctions.php:290 +#, php-format +msgid "could not create directory %s.\n" +msgstr "" + +#: includes/galleryfunctions.php:43 +#, php-format +msgid "required %s not found." +msgstr ""