Commit c5ca2d35 authored by Milan Crha's avatar Milan Crha

Bug 788916 - Localized "Fwd:"/"Re:" can't be disabled

parent 39fb1537
......@@ -190,6 +190,11 @@
<_summary>List of localized “Re” separators</_summary>
<_description>A list of localized “Re” separators, used to skip in a subject text when replying to a message, as an addition to the standard “:” and the Unicode “︰” separators.</_description>
</key>
<key name="composer-use-localized-fwd-re" type="b">
<default>false</default>
<_summary>Use localized “Fwd”/“Re” in message Subject</_summary>
<_description>When set to true, uses localized “Fwd”/“Re” in message Subject on reply and forward as provided by current locale translation, otherwise uses unlocalized version.</_description>
</key>
<key name="composer-word-wrap-length" type="i">
<default>71</default>
<_summary>Number of characters for wrapping</_summary>
......
......@@ -34,6 +34,7 @@
#include <glib/gi18n.h>
#include "e-util/e-util.h"
#include "e-mail-session.h"
#include "mail-folder-cache.h"
#include "mail-tools.h"
......@@ -155,6 +156,8 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg)
gchar *subject = NULL;
gchar *fwd_subj;
const gint max_subject_length = 1024;
const gchar *format;
GSettings *settings;
orig_subject = camel_mime_message_get_subject (msg);
......@@ -189,8 +192,17 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg)
subject = camel_address_format (CAMEL_ADDRESS (from));
}
/* Translators: This is a subject attribution for forwarded messages. The %s is replaced with subject of the original message. */
fwd_subj = g_strdup_printf (_("[Fwd: %s]"),
settings = e_util_ref_settings ("org.gnome.evolution.mail");
if (g_settings_get_boolean (settings, "composer-use-localized-fwd-re")) {
/* Translators: This is a subject attribution for forwarded messages. The %s is replaced with subject of the original message. */
format = _("[Fwd: %s]");
} else {
/* Do not localize this string */
format = "[Fwd: %s]";
}
g_clear_object (&settings);
fwd_subj = g_strdup_printf (format,
/* Translators: This is a subject attribution for forwarded messages, used when there could not be used any subject.
It results in "[Fwd: No Subject]" being used as a subject of the forwarded message. */
(subject && *subject) ? subject : _("No Subject"));
......
......@@ -2553,13 +2553,21 @@ reply_setup_composer (EMsgComposer *composer,
/* Set the subject of the new message. */
if ((subject = (gchar *) camel_mime_message_get_subject (message))) {
GSettings *settings;
gboolean skip_len = -1;
if (em_utils_is_re_in_subject (subject, &skip_len, NULL, NULL) && skip_len > 0)
subject = subject + skip_len;
/* Translators: This is a reply attribution in the message reply subject. The %s is replaced with the subject of the original message. Both 'Re'-s in the 'reply-attribution' translation context should translate into the same string, the same as the ':' separator. */
subject = g_strdup_printf (C_("reply-attribution", "Re: %s"), subject);
settings = e_util_ref_settings ("org.gnome.evolution.mail");
if (g_settings_get_boolean (settings, "composer-use-localized-fwd-re")) {
/* Translators: This is a reply attribution in the message reply subject. The %s is replaced with the subject of the original message. Both 'Re'-s in the 'reply-attribution' translation context should translate into the same string, the same as the ':' separator. */
subject = g_strdup_printf (C_("reply-attribution", "Re: %s"), subject);
} else {
/* Do not localize this string */
subject = g_strdup_printf ("Re: %s", subject);
}
g_clear_object (&settings);
} else {
subject = g_strdup ("");
}
......
......@@ -518,8 +518,8 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkReplyStartBottom">
<property name="label" translatable="yes">Start _typing at the bottom</property>
<object class="GtkCheckButton" id="chkUseLocalizedFwdRe">
<property name="label" translatable="yes" comments="Translators: Do not localize the 'Fwd' and 'Re' here, but feel free to show what it would be in your locale at the end of the string">Use _localized “Fwd”/“Re” in message Subject of Forwards and Replies</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -535,8 +535,8 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkTopSignature">
<property name="label" translatable="yes">_Keep signature above the original message</property>
<object class="GtkCheckButton" id="chkReplyStartBottom">
<property name="label" translatable="yes">Start _typing at the bottom</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -552,8 +552,8 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkSignatureInNewOnly">
<property name="label" translatable="yes">Include si_gnature in new messages only</property>
<object class="GtkCheckButton" id="chkTopSignature">
<property name="label" translatable="yes">_Keep signature above the original message</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -569,8 +569,8 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkIgnoreListReplyTo">
<property name="label" translatable="yes">Ig_nore Reply-To: for mailing lists</property>
<object class="GtkCheckButton" id="chkSignatureInNewOnly">
<property name="label" translatable="yes">Include si_gnature in new messages only</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -586,8 +586,8 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkGroupReplyToList">
<property name="label" translatable="yes">Gro_up Reply goes only to mailing list, if possible</property>
<object class="GtkCheckButton" id="chkIgnoreListReplyTo">
<property name="label" translatable="yes">Ig_nore Reply-To: for mailing lists</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -603,8 +603,8 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkSignReplyIfSigned">
<property name="label" translatable="yes">Digitally _sign messages when original message signed (PGP or S/MIME)</property>
<object class="GtkCheckButton" id="chkGroupReplyToList">
<property name="label" translatable="yes">Gro_up Reply goes only to mailing list, if possible</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
......@@ -619,6 +619,23 @@
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkSignReplyIfSigned">
<property name="label" translatable="yes">Digitally _sign messages when original message signed (PGP or S/MIME)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkWrapQuotedTextInReplies">
<property name="label" translatable="yes">_Wrap quoted text in replies</property>
......@@ -631,8 +648,8 @@
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="y_options"/>
</packing>
</child>
......
......@@ -1192,6 +1192,12 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
widget, "active",
G_SETTINGS_BIND_DEFAULT);
widget = e_builder_get_widget (prefs->builder, "chkUseLocalizedFwdRe");
g_settings_bind (
settings, "composer-use-localized-fwd-re",
widget, "active",
G_SETTINGS_BIND_DEFAULT);
widget = e_builder_get_widget (prefs->builder, "chkReplyStartBottom");
g_settings_bind (
settings, "composer-reply-start-bottom",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment