summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-12-13 01:00:56 +0100
committerCarl Hetherington <cth@carlh.net>2021-12-13 01:00:56 +0100
commit53ebce922b704fe2e39f978c87d86504965b9b46 (patch)
treed38b85939f19228ab18837d7abae466b24a3bf0d
parent9a9a660dd61988a3091c31483b2d32fd136e820e (diff)
Make sure translators give email addresses.
-rw-r--r--src/tools/dcpomatic.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 8bcca9b22..e03b63400 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -1100,8 +1100,17 @@ private:
body += i.first + "\n" + i.second + "\n\n";
}
list<string> to = { "carl@dcpomatic.com" };
- Emailer emailer (d->email(), to, "DCP-o-matic translations", body);
- emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS);
+ if (d->email().find("@") == string::npos) {
+ error_dialog (this, _("You must enter a valid email address when sending translations, "
+ "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions."));
+ } else {
+ Emailer emailer (d->email(), to, "DCP-o-matic translations", body);
+ try {
+ emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS);
+ } catch (NetworkError& e) {
+ error_dialog (this, _("Could not send translations"), std_to_wx(e.what()));
+ }
+ }
}
d->Destroy ();