summaryrefslogtreecommitdiff
path: root/gphoto-m4
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-19 00:06:23 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-25 00:20:21 +0200
commit0b2b6207c24bfab3878185d1f907fd0d960931da (patch)
treea9e6773370c5a9f2b7f358031ec15ac35dd0effe /gphoto-m4
parentb6e9e97fe8a12fde1aa3486be563c3362005de8e (diff)
downloadlibgphoto2-0b2b6207c24bfab3878185d1f907fd0d960931da.tar.gz
Factor out i18n stuff into separate i18n.h files
Factor out the i18n definitions into i18n.h include files: One include file each for libgphoto2 and for libgphoto2_port. This removes the complete #ifdef ENABLE_NLS # include <libintl.h> # undef _ # define _(String) dgettext (GETTEXT_PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define _(String) (String) # define N_(String) (String) #endif block (which in some occasions defines even more macros) and replaces it with a single line #include "libgphoto2/i18n.h" for camlibs and libgphoto2 itself and with #include "libgphoto2_port/i18n.h" for iolibs and libgphoto2_port itself. This gives us two central locations to change the defintions.
Diffstat (limited to 'gphoto-m4')
-rw-r--r--gphoto-m4/gp-gettext-hack.m414
1 files changed, 7 insertions, 7 deletions
diff --git a/gphoto-m4/gp-gettext-hack.m4 b/gphoto-m4/gp-gettext-hack.m4
index f7427745e..940e287de 100644
--- a/gphoto-m4/gp-gettext-hack.m4
+++ b/gphoto-m4/gp-gettext-hack.m4
@@ -23,13 +23,13 @@ dnl
AC_DEFUN([GP_GETTEXT_HACK], [dnl
AC_BEFORE([$0], [AM_GNU_GETTEXT])dnl
AC_BEFORE([$0], [AM_GNU_GETTEXT_VERSION])dnl
-m4_if([$1],[],[GETTEXT_PACKAGE="${PACKAGE_TARNAME}"],[GETTEXT_PACKAGE="$1"])
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
+m4_if([$2],[],[$1="${PACKAGE_TARNAME}"],[$1="$2"])
+AC_DEFINE_UNQUOTED([$1], ["${$1}"],
[The gettext domain we're using])
-AC_SUBST([GETTEXT_PACKAGE])
-sed_cmds="s|^DOMAIN.*|DOMAIN = ${GETTEXT_PACKAGE}|"
-m4_if([$2],[],[],[sed_cmds="${sed_cmds};s|^COPYRIGHT_HOLDER.*|COPYRIGHT_HOLDER = $2|"])
-m4_ifval([$3],[
+AC_SUBST([$1])
+sed_cmds="s|^DOMAIN.*|DOMAIN = ${$1}|"
+m4_if([$3],[],[],[sed_cmds="${sed_cmds};s|^COPYRIGHT_HOLDER.*|COPYRIGHT_HOLDER = $3|"])
+m4_ifval([$4],[
if test -n "$PACKAGE_BUGREPORT"; then
sed_mb="${PACKAGE_BUGREPORT}"
else
@@ -41,7 +41,7 @@ else
])
fi
],[
-sed_mb="$3"
+sed_mb="$4"
])
sed_cmds="${sed_cmds};s|^MSGID_BUGS_ADDRESS.*|MSGID_BUGS_ADDRESS = ${sed_mb}|"
# Not so sure whether this hack is all *that* evil...