summaryrefslogtreecommitdiff
path: root/camlibs/jd11
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 /camlibs/jd11
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 'camlibs/jd11')
-rw-r--r--camlibs/jd11/jd11.c15
-rw-r--r--camlibs/jd11/serial.c19
2 files changed, 3 insertions, 31 deletions
diff --git a/camlibs/jd11/jd11.c b/camlibs/jd11/jd11.c
index 7d49fd346..3fdd02dfa 100644
--- a/camlibs/jd11/jd11.c
+++ b/camlibs/jd11/jd11.c
@@ -27,22 +27,11 @@
#include <gphoto2/gphoto2.h>
#include <gphoto2/gphoto2-port.h>
-#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
+#include "libgphoto2/i18n.h"
#include "serial.h"
+
int camera_id (CameraText *id)
{
strcpy(id->text, "JD11");
diff --git a/camlibs/jd11/serial.c b/camlibs/jd11/serial.c
index 73c44007c..b4cac363c 100644
--- a/camlibs/jd11/serial.c
+++ b/camlibs/jd11/serial.c
@@ -31,28 +31,11 @@
#include <gphoto2/gphoto2-port.h>
#include <libgphoto2/bayer.h>
+#include "libgphoto2/i18n.h"
#include "serial.h"
#include "decomp.h"
-#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 textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif
#if 0
static int