summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-02-08 11:13:05 +0100
committerraveit65 <[email protected]>2021-02-09 10:27:40 +0100
commit0ff5527f5b057d26e75ea7c44ec4ea809c140cdc (patch)
tree6771dc459f2c954cd82b5dbe8114a6603f742338
parent7839311c2c203323609b89f589294778bb4e980f (diff)
downloadengrampa-0ff5527f5b057d26e75ea7c44ec4ea809c140cdc.tar.bz2
engrampa-0ff5527f5b057d26e75ea7c44ec4ea809c140cdc.tar.xz
build: allow users to disable gettext support (--disable-nls)
-rw-r--r--Makefile.am8
-rw-r--r--caja/Makefile.am6
-rw-r--r--configure.ac24
-rw-r--r--data/Makefile.am8
-rw-r--r--help/Makefile.am4
-rw-r--r--src/main.c4
-rw-r--r--src/server.c4
7 files changed, 44 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 6c4f1be..ed65310 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,13 +7,17 @@ else
CAJA =
endif
+if USE_NLS
+PO_SUBDIR = po
+endif
+
SUBDIRS = \
mate-submodules \
data \
src \
help \
- $(CAJA) \
- po
+ $(CAJA) \
+ $(PO_SUBDIR)
distcleancheck_listfiles = find . -type f -print | grep -v 'omf\.out'
diff --git a/caja/Makefile.am b/caja/Makefile.am
index b8310c5..a2c9d06 100644
--- a/caja/Makefile.am
+++ b/caja/Makefile.am
@@ -23,7 +23,11 @@ extension_in_in_files = libcaja-engrampa.caja-extension.desktop.in.in
extension_in_files = $(extension_in_in_files:.caja-extension.desktop.in.in=.caja-extension.desktop.in)
extension_DATA = $(extension_in_files:.caja-extension.desktop.in=.caja-extension)
$(extension_DATA): $(extension_in_files)
- $(AM_V_GEN) $(MSGFMT) --desktop --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@
+if USE_NLS
+ $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Copyright --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@
+else
+ $(AM_V_GEN) cp -f $< $@
+endif
DISTCLEANFILES = $(extension_in_files)
CLEANFILES = $(extension_DATA)
diff --git a/configure.ac b/configure.ac
index 640c208..a20f9ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,9 +136,10 @@ GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [GetText Package])
+AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.8])
-AM_GNU_GETTEXT([external])
+AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" = "xyes"])
dnl ******************************
@@ -249,14 +250,15 @@ Configure summary:
${PACKAGE_STRING}
`echo $PACKAGE_STRING | sed "s/./=/g"`
- Source code location: ${srcdir}
- Compiler: ${CC}
- Compiler flags: ${CFLAGS}
- Warning flags: ${WARN_CFLAGS}
- Linker flags: ${LDFLAGS}
- Caja support: ${enable_caja_actions}
- PackageKit support: ${enable_packagekit}
- Run in place ${enable_run_in_place}
- Use libmagic: ${enable_magic}
- JSON support: ${enable_json_glib}
+ Source code location: ${srcdir}
+ Compiler: ${CC}
+ Compiler flags: ${CFLAGS}
+ Warning flags: ${WARN_CFLAGS}
+ Linker flags: ${LDFLAGS}
+ Caja support: ${enable_caja_actions}
+ PackageKit support: ${enable_packagekit}
+ Run in place ${enable_run_in_place}
+ Use libmagic: ${enable_magic}
+ JSON support: ${enable_json_glib}
+ Native Language support: ${USE_NLS}
"
diff --git a/data/Makefile.am b/data/Makefile.am
index fdc4dde..8ed7529 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -5,7 +5,11 @@ desktop_in_in_files = engrampa.desktop.in.in
desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
$(desktop_DATA): $(desktop_in_files)
+if USE_NLS
$(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+else
+ $(AM_V_GEN) sed '/^# Translators/d' < $< > $@
+endif
matchdir = $(datadir)/engrampa
match_DATA = packages.match
@@ -21,7 +25,11 @@ appdata_in_in_files = engrampa.appdata.xml.in.in
appdata_in_files = $(appdata_in_in_files:.xml.in.in=.xml.in)
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
$(appdata_DATA): $(appdata_in_files)
+if USE_NLS
$(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
+else
+ $(AM_V_GEN) cp -f $< $@
+endif
gsettingsschema_in_files = org.mate.engrampa.gschema.xml.in
gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
diff --git a/help/Makefile.am b/help/Makefile.am
index ab64d33..6181a96 100644
--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -10,9 +10,13 @@ HELP_MEDIA = \
figures/engrampa_uparrow.png
# Add linguas to be ignored, e.g. IGNORE_HELP_LINGUAS = ca de es fr
+if USE_NLS
IGNORE_HELP_LINGUAS =
HELP_LINGUAS = $(if $(IGNORE_HELP_LINGUAS), \
$(filter-out $(IGNORE_HELP_LINGUAS),$(subst /,,$(dir $(wildcard */*.po)))), \
$(subst /,,$(dir $(wildcard */*.po))) )
+else
+HELP_LINGUAS =
+endif
-include $(top_srcdir)/git.mk
diff --git a/src/main.c b/src/main.c
index a9e297d..292f4b1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -317,12 +317,16 @@ main (int argc, char **argv)
program_argv0 = argv[0];
+#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
context = g_option_context_new (N_("- Create and modify an archive"));
+#ifdef ENABLE_NLS
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
diff --git a/src/server.c b/src/server.c
index 1b906de..1ca6c4e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -437,12 +437,16 @@ main (int argc, char *argv[])
GError *error = NULL;
guint owner_id;
+#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
context = g_option_context_new (N_("- Create and modify an archive"));
+#ifdef ENABLE_NLS
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
g_option_context_add_group (context, gtk_get_option_group (TRUE));
if (! g_option_context_parse (context, &argc, &argv, &error)) {