From e0eb181373244e47e25449b072447a8a15dd8518 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 13 Sep 2017 17:10:48 -0600 Subject: [PATCH] Test for overriding Horde's translations with our own --- .../de_DE.utf-8/LC_MESSAGES/Horde_Mime.mo | Bin 0 -> 897 bytes .../de_DE.utf-8/LC_MESSAGES/Horde_Mime.po | 40 ++++++++++++++++++ api/src/Mail.php | 6 +++ 3 files changed, 46 insertions(+) create mode 100644 api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.mo create mode 100644 api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.po diff --git a/api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.mo b/api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.mo new file mode 100644 index 0000000000000000000000000000000000000000..da5c0a2a6c9d8759d66c86c107e785a5acb61027 GIT binary patch literal 897 zcmZuvU2fDc5Drj4$|FMJM?4HwR|2(OlC2P{R4YNdty-yDR#o5;@Fuf~A+cAs(^3wA z-~e0zaSC3!1H5qoF2R>=%L;+z&*SlY_WXE$UR(MUU|a_707Kv^Pyy}u0NeyV0yluq zK+F3Iya#>&#}|U&1#lhv?-zsMHsmkJTaZ^S1;Hywf&?YN@q9p?`)rk^b{Q%+GfsJB zG#wbPrYe)I66~g{%%+qqmEmJ8SO_(+1h@z4woOi=8EtMloZK!CZm2k%7OX;yJUjK8|vdqa?YIKfZ zy)k(=7+cdi5qr5f%OIg$V{?8vQZ}>*}_c@qDJ-wiF$8y`x{}fUC*Y7+fCT{Z(qDB8ePmA={z(P+0uc`N~^Nc2PvXD zI%~1NEknf%9@Wa@W=)&yEl;Otp7j;CyoR=6k~MYW6-N@C)`KkAWu?mAcsg$IjcaHn Q4`adaSQR*I|5kT{-)9pG2><{9 literal 0 HcmV?d00001 diff --git a/api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.po b/api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.po new file mode 100644 index 0000000000..4dc0ef387f --- /dev/null +++ b/api/lang/locale/de_DE.utf-8/LC_MESSAGES/Horde_Mime.po @@ -0,0 +1,40 @@ +# German translations for Horde_Mime module. +# Copyright 2010-2017 Horde LLC (http://www.horde.org/) +# This file is distributed under the same license as the Horde_Mime module. +# Automatically generated, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: Horde_Mime\n" +"Report-Msgid-Bugs-To: dev@lists.horde.org\n" +"POT-Creation-Date: 2015-01-08 11:22+0100\n" +"PO-Revision-Date: 2010-10-13 01:27+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: i18n@lists.horde.org\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: lib/Horde/Mime/Mdn.php:188 +msgid "Disposition Notification" +msgstr "Empfangsbestätigung" + +#: lib/Horde/Mime/Mail.php:439 +msgid "HTML Version of Message" +msgstr "HTML-Version der Nachricht" + +#: lib/Horde/Mime/Mail.php:437 +msgid "Plaintext Version of Message" +msgstr "Textversion der Nachricht" + +#: lib/Horde/Mime/Mdn.php:201 +#, php-format +msgid "" +"The message sent on %s to %s with subject \"%s\" has been displayed.\n" +"\n" +"This is no guarantee that the message has been read or understood." +msgstr "" +"Die Nachricht mit dem Betreff \"%3$s\", die am %1$s an %2$s geschickt wurde, " +"ist angezeigt worden." \ No newline at end of file diff --git a/api/src/Mail.php b/api/src/Mail.php index 071e35340e..040d1682b5 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -27,6 +27,8 @@ use Horde_Mime_Magic; use Horde_Mail_Rfc822; use Horde_Mail_Rfc822_List; use Horde_Mime_Mdn; +use Horde_Translation; +use Horde_Translation_Handler_Gettext; use EGroupware\Api; use tidy; @@ -7248,6 +7250,10 @@ class Mail if (self::$debug) error_log(__METHOD__.__LINE__.array2string($identity)); $headers = $this->getMessageHeader($uid, '', 'object', true, $_folder); + // Override Horde's translation with our own + Horde_Translation::setHandler('Horde_Mime', new Horde_Translation_Handler_Gettext('Horde_Mime', EGW_SERVER_ROOT.'/api/lang/locale')); + Preferences::setlocale(); + $mdn = new Horde_Mime_Mdn($headers); $mdn->generate(true, true, 'displayed', php_uname('n'), $acc->smtpTransport(), array( 'charset' => 'utf-8',