From f2ff370215957f58edb734f65e8c60bcef0f0f47 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 10 Aug 2011 07:09:16 -0400
Subject: [PATCH] Recalculate date when replying to a message and localize the cite header (#1487675)

---
 program/localization/de_DE/labels.inc |    1 +
 CHANGELOG                             |    1 +
 program/steps/mail/compose.inc        |    9 +++++++--
 program/localization/en_US/labels.inc |    1 +
 program/localization/de_CH/labels.inc |    1 +
 5 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index bfaf6b0..c59cbab 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Recalculate date when replying to a message and localize the cite header (#1487675)
 - Fix XSS vulnerability in UI messages (#1488030)
 - Fix handling of email addresses with quoted local part (#1487939)
 - Fix EOL character in vCard exports (#1487873)
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index 46bed71..d2bdf1f 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -172,6 +172,7 @@
 $labels['editortype'] = 'Editor-Typ';
 $labels['returnreceipt'] = 'Empfangsbestätigung (MDN)';
 $labels['dsn'] = 'Übermittlungsbestätigung (DSN)';
+$labels['mailreplyintro'] = 'Am $date, schrieb $sender:';
 $labels['editidents'] = 'Absender bearbeiten';
 $labels['checkspelling'] = 'Rechtschreibung prüfen';
 $labels['resumeediting'] = 'Bearbeitung fortsetzen';
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index bb1d6bb..b3fe642 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -173,6 +173,7 @@
 $labels['editortype'] = 'Editor Typ';
 $labels['returnreceipt'] = 'Empfangsbestätigung (MSN)';
 $labels['dsn'] = 'Übermittlungsbestätigung (DSN)';
+$labels['mailreplyintro'] = 'Am $date, schrieb $sender:';
 $labels['editidents'] = 'Absender ändern';
 $labels['checkspelling'] = 'Rechtschreibung prüfen';
 $labels['resumeediting'] = 'Bearbeitung fortsetzen';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index b6de28b..efbc9a6 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -202,6 +202,7 @@
 $labels['editortype']     = 'Editor type';
 $labels['returnreceipt']  = 'Return receipt';
 $labels['dsn']            = 'Delivery status notification';
+$labels['mailreplyintro'] = 'On $date, $sender wrote:';
 
 $labels['editidents']    = 'Edit identities';
 $labels['checkspelling'] = 'Check spelling';
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 1934194..31de0d9 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -758,8 +758,13 @@
 
   // build reply prefix
   $from = array_pop($RCMAIL->imap->decode_address_list($MESSAGE->get_header('from'), 1, false));
-  $prefix = sprintf("On %s, %s wrote:",
-    $MESSAGE->headers->date, $from['name'] ? $from['name'] : rcube_idn_to_utf8($from['mailto']));
+  $prefix = rcube_label(array(
+    'name' => 'mailreplyintro',
+    'vars' => array(
+      'date' => format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')),
+      'sender' => $from['name'] ? $from['name'] : rcube_idn_to_utf8($from['mailto']),
+    )
+  ));
 
   if (!$bodyIsHtml) {
     $body = preg_replace('/\r?\n/', "\n", $body);

--
Gitblit v1.9.1