Localization: fix localization support.

Correct initalizing textdomain.
Use LOCALE_DIR environment variable.
Support localization in setting.c and text_setting.c files.
This commit is contained in:
Mykyta Biliavskyi 2015-12-10 17:30:00 +09:00
parent 6aea530622
commit 360170fd74
5 changed files with 24 additions and 1 deletions

View File

@ -40,6 +40,14 @@ AM_PROG_AS
AM_GNU_GETTEXT_VERSION(0.18.1)
AM_GNU_GETTEXT([external])
#===============================================================================
if test "x${prefix}" = "xNONE"; then
LOCALE_DIR="${ac_default_prefix}/share/locale"
else
LOCALE_DIR="${prefix}/share/locale"
fi
AC_SUBST(LOCALE_DIR)
#===============================================================================
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##

View File

@ -1,5 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
LOCALE_DIR = @LOCALE_DIR@
bin_PROGRAMS = enventor
AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \
@ -35,6 +37,7 @@ enventor_LDFLAGS = $(LTLIBINTL)
enventor_CFLAGS = \
-I$(top_builddir)/src/lib \
@ENVENTOR_CFLAGS@
@ENVENTOR_CFLAGS@ \
-DLOCALE_DIR=\"@LOCALE_DIR@\"
EXTRA_DIST =

View File

@ -875,6 +875,12 @@ keygrabber_init(app_data *ad)
static Eina_Bool
init(app_data *ad, int argc, char **argv)
{
#ifdef ENABLE_NLS
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALE_DIR);
textdomain(PACKAGE);
#endif /* set locale */
elm_setup();
enventor_init(argc, argv);

View File

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "common.h"
#include "text_setting.h"

View File

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "common.h"
#include "text_setting.h"