Commit 17a23bc5 authored by Michael Gratton's avatar Michael Gratton 🤞

ComposerWidget: Send both en and localised attachment keywords

Ensures that the English keyword is always checked since en+something
is somewhat common.

See #589
parent 69e3cdf9
Pipeline #121803 passed with stages
in 14 minutes and 23 seconds
......@@ -161,11 +161,17 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
private const string URI_LIST_MIME_TYPE = "text/uri-list";
private const string FILE_URI_PREFIX = "file://";
// Keep these in sync with the next const below.
private const string ATTACHMENT_KEYWORDS =
"attach|attaching|attaches|attachment|attachments|attached|enclose|enclosed|enclosing|encloses|enclosure|enclosures";
// Translators: This is list of keywords, separated by pipe ("|")
// characters, that suggest an attachment; since this is full-word
// checking, include all variants of each word. No spaces are
// allowed.
private const string ATTACHMENT_KEYWORDS_LOCALIZED = _("attach|attaching|attaches|attachment|attachments|attached|enclose|enclosed|enclosing|encloses|enclosure|enclosures");
// checking, include all variants of each word. No spaces are
// allowed. The words will be converted to lower case based on
// locale and English versions included automatically.
private const string ATTACHMENT_KEYWORDS_LOCALISED =
_("attach|attaching|attaches|attachment|attachments|attached|enclose|enclosed|enclosing|encloses|enclosure|enclosures");
public Geary.Account account { get; private set; }
private Gee.Map<string, Geary.AccountInformation> accounts;
......@@ -1334,7 +1340,12 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
confirmation = _("Send message with an empty body?");
} else if (!has_attachment &&
yield this.editor.contains_attachment_keywords(
ATTACHMENT_KEYWORDS_LOCALIZED, this.subject)) {
string.join(
"|",
ATTACHMENT_KEYWORDS,
ATTACHMENT_KEYWORDS_LOCALISED
),
this.subject)) {
confirmation = _("Send message without an attachment?");
}
if (confirmation != null) {
......
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