diff options
Diffstat (limited to 'src/pgp')
-rw-r--r-- | src/pgp/Makefile | 2 | ||||
-rw-r--r-- | src/pgp/main.vala | 18 | ||||
-rw-r--r-- | src/pgp/pgp.vala | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/pgp/Makefile b/src/pgp/Makefile index 6292111..5faa80f 100644 --- a/src/pgp/Makefile +++ b/src/pgp/Makefile @@ -2,7 +2,7 @@ all: pgp @echo > /dev/null pgp: main.vala pgp.vala pgp-interface.vala ../config/config-interface.vala - valac --Xcc="-D_FILE_OFFSET_BITS=64" -X -w -o $@ --vapidir ../../vapi -X -lgpgme --pkg gpgme --pkg gio-2.0 --pkg libarchive $^ + valac -X -D'GETTEXT_PACKAGE="shopsystem"' --Xcc="-D_FILE_OFFSET_BITS=64" -X -w -o $@ --vapidir ../../vapi -X -lgpgme --pkg gpgme --pkg gio-2.0 --pkg libarchive $^ clean: rm -rf pgp diff --git a/src/pgp/main.vala b/src/pgp/main.vala index 332bcd5..74bcf0e 100644 --- a/src/pgp/main.vala +++ b/src/pgp/main.vala @@ -21,35 +21,37 @@ PGPKeyArchive pgp; Config cfg; public static int main(string[] args) { + Intl.setlocale(LocaleCategory.ALL, ""); + Intl.textdomain("shopsystem"); + try { cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config"); pgp = new PGPKeyArchive(cfg.get_string("PGP", "keyring")); } catch(DBusError e) { - error("DBusError: %s\n", e.message); + error(_("DBus Error: %s\n"), e.message); } catch(IOError e) { - error("IOError: %s\n", e.message); + error(_("IO Error: %s\n"), e.message); } catch(KeyFileError e) { - error("Config Error: %s\n", e.message); + error(_("Config Error: %s\n"), e.message); } - Bus.own_name( BusType.SYSTEM, "io.mainframe.shopsystem.PGP", BusNameOwnerFlags.NONE, - on_bus_aquired, + on_bus_acquired, () => {}, - () => stderr.printf("Could not aquire name\n")); + () => stderr.printf(_("Could not acquire name\n"))); new MainLoop().run(); return 0; } -void on_bus_aquired(DBusConnection con) { +void on_bus_acquired(DBusConnection con) { try { con.register_object("/io/mainframe/shopsystem/pgp", pgp); } catch(IOError e) { - stderr.printf("Could not register service\n"); + stderr.printf(_("Could not register service\n")); } } diff --git a/src/pgp/pgp.vala b/src/pgp/pgp.vala index 2a5b160..6d9bed0 100644 --- a/src/pgp/pgp.vala +++ b/src/pgp/pgp.vala @@ -120,7 +120,7 @@ public class PGPKeyArchive { keydata.read(data); return (string) data; } else { - stdout.printf("error!\n"); + stdout.printf(_("Error!\n")); return ""; } } |