diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2009-08-27 14:34:12 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2009-08-27 14:34:12 +0200 |
commit | 5aafe234442fa9cebe7202ef38ca213850eb5be8 (patch) | |
tree | 2b5482f9692344775eb9804c6e8a8d86ceaf318d /src/Applet/Applet.cpp | |
parent | 8c0d6a2a3eb9ed0f31e9dbd4ff1c18929932b982 (diff) | |
download | abrt-5aafe234442fa9cebe7202ef38ca213850eb5be8.tar.gz abrt-5aafe234442fa9cebe7202ef38ca213850eb5be8.tar.xz abrt-5aafe234442fa9cebe7202ef38ca213850eb5be8.zip |
CCApplet: gettext support
Diffstat (limited to 'src/Applet/Applet.cpp')
-rw-r--r-- | src/Applet/Applet.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index 53f00436..0c2901ba 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -21,6 +21,21 @@ #include <iostream> #include <dbus/dbus-shared.h> +#if HAVE_CONFIG_H + #include <config.h> +#endif + +#if HAVE_LOCALE_H + #include <locale.h> +#endif + +#if ENABLE_NLS + #include <libintl.h> + #define _(S) gettext(S) +#else + #define _(S) (S) +#endif + //@@global applet object CApplet *applet; @@ -31,12 +46,19 @@ crash_notify_cb(const char* progname) std::cerr << "Application " << progname << " has crashed!" << std::endl; #endif //applet->AddEvent(uid, std::string(progname)); - applet->SetIconTooltip("A crash in package %s has been detected!", progname); + applet->SetIconTooltip(_("A crash in package %s has been detected!"), progname); applet->ShowIcon(); } int main(int argc, char **argv) { + setlocale(LC_ALL,""); + +#if ENABLE_NLS + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); +#endif + /* need to be thread safe */ g_thread_init(NULL); gdk_threads_init(); @@ -55,7 +77,7 @@ int main(int argc, char **argv) if(session.has_name("com.redhat.abrt.applet")) { //applet is already running - std::cerr << "Applet is already running." << std::endl; + std::cerr << _("Applet is already running.") << std::endl; return -1; } else @@ -69,8 +91,8 @@ int main(int argc, char **argv) applet->ConnectCrashHandler(crash_notify_cb); if(!conn.has_name(CC_DBUS_NAME)) { - std::cout << "Daemon is not running" << std::endl; - applet->Disable("Daemon is not running"); + std::cout << _("Daemon is not running.") << std::endl; + applet->Disable(_("Daemon is not running.")); } gtk_main(); |