Browse Source

german translation for galleryfunctions.php (addresses #43)

* add Makefile to generate gettext .pot, .po and .mo files
 * mark translatable texts in galleryfunctions.php
master
Jan Dittberner 12 years ago
parent
commit
fafd016bae
  1. 26
      Makefile
  2. 7
      includes/galleryfunctions.php
  3. BIN
      locale/de/LC_MESSAGES/sjqg.mo
  4. 30
      locale/de/LC_MESSAGES/sjqg.po
  5. 31
      locale/sjqg.pot

26
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 <jan@dittberner.info>' \
--package-name='SJQG' --package-version='0.3' \
--language=PHP $(OBJECTS)
.SECONDARY:

7
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;
}

BIN
locale/de/LC_MESSAGES/sjqg.mo

Binary file not shown.

30
locale/de/LC_MESSAGES/sjqg.po

@ -0,0 +1,30 @@
# German translation for SJQG
# Copyright (C) 2009 Jan Dittberner <jan@dittberner.info>
# This file is distributed under the same license as the
# scrollingJqueryGallery package.
# Jan Dittberner <jan@dittberner.info>, 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 <jan@dittberner.info>\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."

31
locale/sjqg.pot

@ -0,0 +1,31 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Jan Dittberner <jan@dittberner.info>
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 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 <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"
#: 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 ""
Loading…
Cancel
Save