summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-11-03 05:56:15 +0000
committerDana Jansens <danakj@orodu.net>2002-11-03 05:56:15 +0000
commitbbdca491933fd906bb65cc201c8636d24d4cda71 (patch)
treefb8580a6b3a20bc9d331a5057cb6ca1659134d1e /src
parente5d63c070c2787acef59163de77e2a6d66ca0f90 (diff)
gettext is ready to rock and roll
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am6
-rw-r--r--src/blackbox.cc1
-rw-r--r--src/main.cc5
-rw-r--r--src/xatom.cc2
4 files changed, 10 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 0936920b..9adefeeb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,11 @@
+localedir=$(datadir)/locale
DEFAULT_MENU=$(pkgdatadir)/menu
DEFAULT_STYLE=$(pkgdatadir)/styles/mbdtex
CPPFLAGS=`pkg-config --cflags xft` @CPPFLAGS@ \
-DDEFAULTMENU=\"$(DEFAULT_MENU)\" \
--DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\"
+-DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \
+-DLOCALEDIR=\"$(localedir)\"
LDFLAGS=`pkg-config --libs xft`
@@ -11,7 +13,7 @@ INCLUDES= -I../otk
bin_PROGRAMS= openbox
-openbox_LDADD=../otk/libotk.a
+openbox_LDADD=../otk/libotk.a @LIBINTL@
openbox_SOURCES= basedisplay.cc configuration.cc screen.cc timer.cc util.cc \
window.cc workspace.cc xatom.cc blackbox.cc main.cc
diff --git a/src/blackbox.cc b/src/blackbox.cc
index 8e921467..8040ca36 100644
--- a/src/blackbox.cc
+++ b/src/blackbox.cc
@@ -89,6 +89,7 @@ Blackbox *blackbox;
Blackbox::Blackbox(char **m_argv, char *dpy_name, char *rc)
: BaseDisplay(m_argv[0], dpy_name) {
+
if (! XSupportsLocale())
fprintf(stderr, "X server does not support locale\n");
diff --git a/src/main.cc b/src/main.cc
index 4ea8aaf1..2bc4b3ce 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -94,6 +94,11 @@ int main(int argc, char **argv) {
char *rc_file = (char *) 0;
char *menu_file = (char *) 0;
+ // initialize the locale
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
for (int i = 1; i < argc; ++i) {
if (! strcmp(argv[i], "-rc")) {
// look for alternative rc file to use
diff --git a/src/xatom.cc b/src/xatom.cc
index 5561503a..0e92e471 100644
--- a/src/xatom.cc
+++ b/src/xatom.cc
@@ -1,7 +1,5 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#include "../config.h"
-
#ifdef HAVE_CONFIG_H
# include "../config.h"
#endif // HAVE_CONFIG_H