diff --git a/Makefile.in b/Makefile.in index 3402627..27210f1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -834,7 +834,7 @@ all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installe @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} -SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs tests +SUBDIRS = . m4macros glib gmodule gthread gobject gio po DIST_SUBDIRS = $(SUBDIRS) build bin_SCRIPTS = glib-gettextize AM_CPPFLAGS = \ diff --git a/configure.ac b/configure.ac index b9c3342..e421aa0 100644 --- a/configure.ac +++ b/configure.ac @@ -465,13 +465,6 @@ ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) GLIB_GNU_GETTEXT -if test "$gt_cv_have_gettext" != "yes" ; then - AC_MSG_ERROR([ -*** You must have either have gettext support in your C library, or use the -*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html -]) -fi - LIBS="$INTLLIBS $LIBS" GETTEXT_PACKAGE=glib20 diff --git a/glib/ggettext.c b/glib/ggettext.c index bf74ccb..b9e57ef 100644 --- a/glib/ggettext.c +++ b/glib/ggettext.c @@ -40,7 +40,7 @@ #include #include -#include + #ifdef G_OS_WIN32 @@ -55,36 +55,7 @@ gchar * _glib_get_locale_dir (void) { - gchar *install_dir = NULL, *locale_dir; - gchar *retval = NULL; - - if (glib_dll != NULL) - install_dir = g_win32_get_package_installation_directory_of_module (glib_dll); - - if (install_dir) - { - /* - * Append "/share/locale" or "/lib/locale" depending on whether - * autoconfigury detected GNU gettext or not. - */ - const char *p = GLIB_LOCALE_DIR + strlen (GLIB_LOCALE_DIR); - while (*--p != '/') - ; - while (*--p != '/') - ; - - locale_dir = g_build_filename (install_dir, p, NULL); - - retval = g_win32_locale_filename_from_utf8 (locale_dir); - - g_free (install_dir); - g_free (locale_dir); - } - - if (retval) - return retval; - else - return g_strdup (""); + return g_strdup (""); } #undef GLIB_LOCALE_DIR @@ -92,27 +63,6 @@ _glib_get_locale_dir (void) #endif /* G_OS_WIN32 */ -static void -ensure_gettext_initialized (void) -{ - static gsize initialised; - - if (g_once_init_enter (&initialised)) - { -#ifdef G_OS_WIN32 - gchar *tmp = _glib_get_locale_dir (); - bindtextdomain (GETTEXT_PACKAGE, tmp); - g_free (tmp); -#else - bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR); -#endif -# ifdef HAVE_BIND_TEXTDOMAIN_CODESET - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); -# endif - g_once_init_leave (&initialised, TRUE); - } -} - /** * glib_gettext: * @str: The string to be translated @@ -126,8 +76,6 @@ ensure_gettext_initialized (void) const gchar * glib_gettext (const gchar *str) { - ensure_gettext_initialized (); - return g_dgettext (GETTEXT_PACKAGE, str); } @@ -150,8 +98,6 @@ const gchar * glib_pgettext (const gchar *msgctxtid, gsize msgidoffset) { - ensure_gettext_initialized (); - return g_dpgettext (GETTEXT_PACKAGE, msgctxtid, msgidoffset); } diff --git a/glib/gi18n.h b/glib/gi18n.h index f765c3d..a06507f 100644 --- a/glib/gi18n.h +++ b/glib/gi18n.h @@ -20,13 +20,16 @@ #include -#include #include -#define _(String) gettext (String) +#define _(String) (String) #define Q_(String) g_dpgettext (NULL, String, 0) #define N_(String) (String) #define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1) #define NC_(Context, String) (String) +#define textdomain(...) +#define bindtextdomain(...) +#define bind_textdomain_codeset(...) + #endif /* __G_I18N_H__ */