summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-25 21:55:28 +0100
committerraveit65 <[email protected]>2021-02-07 14:10:56 +0100
commit7578472e39bbf4f23985a30858e1b7d324b39c9a (patch)
tree049de08e10e7ca08520a1a32594555dd0bfe1340
parente1431577975f16550213502f5e6767db240c5124 (diff)
downloadmate-menus-7578472e39bbf4f23985a30858e1b7d324b39c9a.tar.bz2
mate-menus-7578472e39bbf4f23985a30858e1b7d324b39c9a.tar.xz
build: allow users to disable gettext support (--disable-nls)
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac5
-rw-r--r--desktop-directories/Makefile.am4
-rw-r--r--po/POTFILES.in1
-rw-r--r--util/test-menu-spec.c8
5 files changed, 21 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 084ca65..14434e7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,8 @@
-SUBDIRS = po libmenu desktop-directories layout util
+if USE_NLS
+PO_SUBDIR = po
+endif
+
+SUBDIRS = $(PO_SUBDIR) libmenu desktop-directories layout util
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/configure.ac b/configure.ac
index 1a3713e..f6c2a8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,9 +24,9 @@ MATE_COMPILE_WARNINGS
LIB_MENU_LT_VERSION=6:9:4
AC_SUBST(LIB_MENU_LT_VERSION)
-AM_GNU_GETTEXT_VERSION([0.19.8])
-AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" = "xyes"])
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
@@ -103,5 +103,6 @@ echo "
Turn on debugging: ${ax_enable_debug}
Build introspection support: ${found_introspection}
+ Native Language support: ${USE_NLS}
"
diff --git a/desktop-directories/Makefile.am b/desktop-directories/Makefile.am
index d3f8cb4..b09d2ee 100644
--- a/desktop-directories/Makefile.am
+++ b/desktop-directories/Makefile.am
@@ -30,7 +30,11 @@ directory_in_files = \
directory_DATA = $(directory_in_files:.directory.in=.directory)
%.directory: %.directory.in
+if USE_NLS
$(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o [email protected]
+else
+ $(AM_V_GEN) cp $< [email protected]
+endif
EXTRA_DIST= $(directory_in_files)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e5fdbda..8bea406 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -21,3 +21,4 @@ desktop-directories/mate-utility.directory.in
desktop-directories/mate-menu-applications.directory.in
desktop-directories/mate-menu-system.directory.in
desktop-directories/mate-other.directory.in
+util/test-menu-spec.c
diff --git a/util/test-menu-spec.c b/util/test-menu-spec.c
index 2b742fc..9de1ab6 100644
--- a/util/test-menu-spec.c
+++ b/util/test-menu-spec.c
@@ -19,7 +19,9 @@
#include <config.h>
#include <glib/gi18n.h>
+#ifdef ENABLE_NLS
#include <locale.h>
+#endif
#include "matemenu-tree.h"
@@ -202,7 +204,13 @@ main (int argc, char **argv)
MateMenuTreeFlags flags;
GError *error = NULL;
+#ifdef ENABLE_NLS
setlocale(LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
options_context = g_option_context_new(_("- test MATE's implementation of the Desktop Menu Specification"));
g_option_context_add_main_entries(options_context, options, GETTEXT_PACKAGE);
g_option_context_parse(options_context, &argc, &argv, NULL);