summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2014-07-12 16:15:39 +0200
committerBoris Faure <billiob@gmail.com>2014-07-26 11:37:26 +0200
commit0ebe84383b8a1f833a3244194098da12a4b47930 (patch)
tree2d2ea4b8d64dc17992119b624a0d766941172af7 /src
parentb14042aa498bff1f1fe791d9014e403e769219ae (diff)
Add (early) gettext support
Diffstat (limited to 'src')
-rw-r--r--src/bin/Makefile.am7
-rw-r--r--src/bin/controls.c2
-rw-r--r--src/bin/main.c9
-rw-r--r--src/bin/private.h6
4 files changed, 23 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 56cedeb..3bb2db9 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -8,6 +8,13 @@ terminology_CPPFLAGS = -I. \
8-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @TERMINOLOGY_CFLAGS@ 8-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @TERMINOLOGY_CFLAGS@
9 9
10terminology_LDADD = @TERMINOLOGY_LIBS@ @ELDBUS_LIBS@ 10terminology_LDADD = @TERMINOLOGY_LIBS@ @ELDBUS_LIBS@
11if HAVE_PO
12terminology_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"
13terminology_LDADD += @LIBINTL@
14endif
15
16
17
11 18
12terminology_SOURCES = \ 19terminology_SOURCES = \
13private.h \ 20private.h \
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 3fb8658..ba51792 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -290,7 +290,7 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
290 o = _sep_add_h(win); 290 o = _sep_add_h(win);
291 elm_box_pack_end(ct_box, o); 291 elm_box_pack_end(ct_box, o);
292 292
293 o = _button_add(win, "About", "about", _cb_ct_about, NULL); 293 o = _button_add(win, _("About"), "about", _cb_ct_about, NULL);
294 elm_box_pack_end(ct_box, o); 294 elm_box_pack_end(ct_box, o);
295 295
296 evas_object_event_callback_add(ct_frame, EVAS_CALLBACK_DEL, 296 evas_object_event_callback_add(ct_frame, EVAS_CALLBACK_DEL,
diff --git a/src/bin/main.c b/src/bin/main.c
index f6f099c..b1e76fb 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_PO
2#include <locale.h>
3#endif
1#include "private.h" 4#include "private.h"
2 5
3#include <Ecore_Getopt.h> 6#include <Ecore_Getopt.h>
@@ -2795,6 +2798,12 @@ elm_main(int argc, char **argv)
2795 int pos_x = 0, pos_y = 0; 2798 int pos_x = 0, pos_y = 0;
2796 int size_w = 1, size_h = 1; 2799 int size_w = 1, size_h = 1;
2797 2800
2801 elm_language_set("");
2802#ifdef HAVE_GETTEXT
2803 bindtextdomain(PACKAGE, LOCALEDIR);
2804 textdomain(PACKAGE);
2805#endif
2806
2798 _log_domain = eina_log_domain_register("terminology", NULL); 2807 _log_domain = eina_log_domain_register("terminology", NULL);
2799 if (_log_domain < 0) 2808 if (_log_domain < 0)
2800 { 2809 {
diff --git a/src/bin/private.h b/src/bin/private.h
index 74a661c..c4531d5 100644
--- a/src/bin/private.h
+++ b/src/bin/private.h
@@ -5,6 +5,12 @@
5#include "terminology_config.h" 5#include "terminology_config.h"
6#endif 6#endif
7 7
8#ifdef HAVE_GETTEXT
9#define _(string) gettext (string)
10#else
11#define _(string) (string)
12#endif
13
8extern int _log_domain; 14extern int _log_domain;
9 15
10#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__) 16#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)