summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2009-09-02 11:39:27 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2009-09-02 11:39:27 +0200
commit84ae8a43927b479a8b3565e43d0b3a109b164c21 (patch)
tree80a7bed6a04fdb9628b0b039b72050bc6175b712 /src
parent6f27b31e64229bf15670b48a19b0348888b0ca28 (diff)
downloadabrt-84ae8a43927b479a8b3565e43d0b3a109b164c21.tar.gz
abrt-84ae8a43927b479a8b3565e43d0b3a109b164c21.tar.xz
abrt-84ae8a43927b479a8b3565e43d0b3a109b164c21.zip
add gettext support for all plugins
Diffstat (limited to 'src')
-rw-r--r--src/Daemon/Daemon.cpp23
-rw-r--r--src/Daemon/Makefile.am2
2 files changed, 25 insertions, 0 deletions
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index ddde1151..be9c9c28 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -34,6 +34,22 @@
#define VAR_RUN_PIDFILE VAR_RUN"/abrt.pid"
+#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
+
+
//FIXME: add some struct to be able to join all threads!
typedef struct cron_callback_data_t
{
@@ -528,6 +544,13 @@ int main(int argc, char** argv)
bool daemonize = true;
int opt;
+ setlocale(LC_ALL,"");
+
+#if ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
while ((opt = getopt(argc, argv, "dv")) != -1)
{
switch (opt)
diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am
index 03c0c7d6..6961960f 100644
--- a/src/Daemon/Makefile.am
+++ b/src/Daemon/Makefile.am
@@ -40,5 +40,7 @@ dist_daemonconf_DATA = abrt.conf
man_MANS = abrt.8 abrt.conf.5
EXTRA_DIST = $(man_MANS)
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
install-data-local:
$(mkdir_p) '$(DESTDIR)/$(VAR_RUN)'