summaryrefslogtreecommitdiffstats
path: root/src/mail
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail')
-rw-r--r--src/mail/Makefile2
-rw-r--r--src/mail/mailer.vala14
-rw-r--r--src/mail/main.vala13
3 files changed, 16 insertions, 13 deletions
diff --git a/src/mail/Makefile b/src/mail/Makefile
index 47819dd..70e9b5a 100644
--- a/src/mail/Makefile
+++ b/src/mail/Makefile
@@ -2,7 +2,7 @@ all: mailer
@echo > /dev/null
mailer: main.vala mailer.vala mail.vala mailer-interface.vala ../config/config-interface.vala
- valac -X -w -o $@ --vapidir=../../vapi --pkg posix --pkg libesmtp --pkg gio-2.0 --pkg gmime-3.0 -X -D_GNU_SOURCE -X -lesmtp -X -lssl -X -lcrypto -X -ldl -X -pthread $^
+ valac -X -D'GETTEXT_PACKAGE="shopsystem"' -X -w -o $@ --vapidir=../../vapi --pkg posix --pkg libesmtp --pkg gio-2.0 --pkg gmime-3.0 -X -D_GNU_SOURCE -X -lesmtp -X -lssl -X -lcrypto -X -ldl -X -pthread $^
clean:
rm -f mailer
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;
diff --git a/src/mail/main.vala b/src/mail/main.vala
index 989c4f1..b3a7088 100644
--- a/src/mail/main.vala
+++ b/src/mail/main.vala
@@ -17,30 +17,33 @@ MailerImplementation m;
DBusConnection mail_bus;
public static int main(string[] args) {
+ Intl.setlocale(LocaleCategory.ALL, "");
+ Intl.textdomain("shopsystem");
+
try {
m = new MailerImplementation();
} catch(Error e) {
- stderr.printf("Error: %s\n", e.message);
+ stderr.printf(_("Error: %s\n"), e.message);
}
Bus.own_name(
BusType.SYSTEM,
"io.mainframe.shopsystem.Mail",
BusNameOwnerFlags.NONE,
- on_mail_bus_aquired,
+ on_mail_bus_acquired,
() => {},
- () => stderr.printf("Error: Could not aquire name\n"));
+ () => stderr.printf(_("Error: Could not acquire name\n")));
new MainLoop().run();
return 0;
}
-void on_mail_bus_aquired(DBusConnection con) {
+void on_mail_bus_acquired(DBusConnection con) {
try {
mail_bus = con;
con.register_object("/io/mainframe/shopsystem/mailer", m);
} catch(IOError e) {
- stderr.printf("Error: Could not register service\n");
+ stderr.printf(_("Error: Could not register service\n"));
}
}