summaryrefslogtreecommitdiffstats
path: root/src/mail/mailer.vala
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2018-06-28 21:35:23 +0200
committerSebastian Reichel <sre@ring0.de>2018-06-28 23:15:27 +0200
commitea64727f90a5f9a66c2fa81612e46ecdae438303 (patch)
tree87d51301d0124e3a01fc434413b38a63ecdd31ef /src/mail/mailer.vala
parentfb75ceb1c5a415cc6667043b1123e42586b1d9b1 (diff)
downloadserial-barcode-scanner-testing.tar.bz2
all: I18N supporttesting
This adds I18N support using standard gettext system together with an initial German translation. This can be used to search locales in some directory: Intl.bindtextdomain("shopsystem", "/home/sre/src/serial-barcode-scanner"); And this can be used to switch language at runtime: Intl.setlocale(LocaleCategory.ALL, "");
Diffstat (limited to 'src/mail/mailer.vala')
-rw-r--r--src/mail/mailer.vala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mail/mailer.vala b/src/mail/mailer.vala
index c8d609c..3d7a996 100644
--- a/src/mail/mailer.vala
+++ b/src/mail/mailer.vala
@@ -76,7 +76,7 @@ public class MailerImplementation {
var cfgport = config.get_integer("MAIL", "port");
server = @"$cfgserv:$cfgport";
} catch(KeyFileError e) {
- throw new IOError.FAILED("server or port configuration is missing");
+ throw new IOError.FAILED(_("server or port configuration is missing"));
}
try {
@@ -96,7 +96,7 @@ public class MailerImplementation {
/* setup server */
result = session.set_server(server);
if(result == 0)
- throw new IOError.FAILED("could not setup server");
+ throw new IOError.FAILED(_("could not setup server"));
/* Use TLS if possible */
if (starttls)
@@ -104,7 +104,7 @@ public class MailerImplementation {
else
result = session.starttls_enable(Smtp.StartTlsOption.DISABLED);
if(result == 0)
- throw new IOError.FAILED("could not configure STARTTLS");
+ throw new IOError.FAILED(_("could not configure STARTTLS"));
/* setup authentication */
if(username != "") {
@@ -138,7 +138,7 @@ public class MailerImplementation {
public void delete_mail(string path) throws DBusError, IOError {
if(!(path in mails))
- throw new IOError.NOT_FOUND("No such mail");
+ throw new IOError.NOT_FOUND(_("No such mail"));
mail_bus.unregister_object(mails[path].registration_id);
mails.remove(path);
@@ -146,7 +146,7 @@ public class MailerImplementation {
public void send_mail(string path) throws DBusError, IOError {
if(!(path in mails))
- throw new IOError.NOT_FOUND("No such mail");
+ throw new IOError.NOT_FOUND(_("No such mail"));
send_queue.push_tail(mails[path].mail);
delete_mail(path);
@@ -173,11 +173,11 @@ public class MailerImplementation {
int result = session.start_session();
if(result == 0)
- throw new IOError.FAILED("eSMTP: Start Session failed!");
+ throw new IOError.FAILED(_("eSMTP: Start Session failed!"));
unowned Smtp.Status status = message.transfer_status();
if(status.code < 200 || status.code >= 300)
- throw new IOError.FAILED("Reply from SMTP-Server: %s", status.text);
+ throw new IOError.FAILED(_("Reply from SMTP-Server: %s"), status.text);
current_mail = null;