diff options
author | rbuj <[email protected]> | 2021-02-08 14:54:49 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-02-10 23:58:25 +0100 |
commit | 1d3eb340559c8a593bfc877aa4fef1198565bd1f (patch) | |
tree | 4be2cdff8aba4567c887c16519c44ed72f2921f7 | |
parent | b9e8446945d36482f968f3356b7dcb14ae9104a5 (diff) | |
download | atril-1d3eb340559c8a593bfc877aa4fef1198565bd1f.tar.bz2 atril-1d3eb340559c8a593bfc877aa4fef1198565bd1f.tar.xz |
dvi: use glib i18n macros
-rw-r--r-- | backend/dvi/mdvi-lib/Makefile.am | 4 | ||||
-rw-r--r-- | backend/dvi/mdvi-lib/private.h | 14 | ||||
-rw-r--r-- | backend/dvi/mdvi-lib/util.c | 20 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | po/POTFILES.in | 15 |
5 files changed, 37 insertions, 20 deletions
diff --git a/backend/dvi/mdvi-lib/Makefile.am b/backend/dvi/mdvi-lib/Makefile.am index 5edcdd03..e41b10bc 100644 --- a/backend/dvi/mdvi-lib/Makefile.am +++ b/backend/dvi/mdvi-lib/Makefile.am @@ -37,7 +37,9 @@ libmdvi_la_SOURCES = \ tfmfile.c \ tt.c \ util.c \ - vf.c + vf.c +libmdvi_la_LIBADD = $(GLIB_LIBS) +libmdvi_la_CFLAGS = $(GLIB_CFLAGS) -include $(top_srcdir)/git.mk diff --git a/backend/dvi/mdvi-lib/private.h b/backend/dvi/mdvi-lib/private.h index 9f89dc70..9bb89e13 100644 --- a/backend/dvi/mdvi-lib/private.h +++ b/backend/dvi/mdvi-lib/private.h @@ -16,8 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _MDVI_PRIVATE_H -#define _MDVI_PRIVATE_H 1 +#include <config.h> +#include <glib/gi18n-lib.h> + +#define _MDVI_PRIVATE_H 1 #define HAVE_PROTOTYPES 1 #if STDC_HEADERS @@ -45,15 +48,6 @@ #define SKIPSP(p) while(ISSP(p)) p++ #define SKIPNSP(p) while(*(p) && !ISSP(p)) p++ -#ifdef ENABLE_NLS -#include <libintl.h> -#define _(x) gettext(x) -#define _G(x) x -#else -#define _(x) x -#define _G(x) x -#endif /* ENABLE_NLS */ - #if defined (__i386__) && defined (__GNUC__) && __GNUC__ >= 2 #define _BREAKPOINT() do { __asm__ __volatile__ ("int $03"); } while(0) #elif defined (__alpha__) && defined (__GNUC__) && __GNUC__ >= 2 diff --git a/backend/dvi/mdvi-lib/util.c b/backend/dvi/mdvi-lib/util.c index 15b53f13..feb55ee8 100644 --- a/backend/dvi/mdvi-lib/util.c +++ b/backend/dvi/mdvi-lib/util.c @@ -17,6 +17,8 @@ */ #include <config.h> +#include <glib/gi18n-lib.h> + #include <stdio.h> #include <stdlib.h> #include <stdarg.h> @@ -30,14 +32,14 @@ #include "private.h" static char *const messages[] = { - _G("Ooops!"), - _G("Aieeeee!!"), - _G("Ouch!"), - _G("Houston, we have a problem"), - _G("3.. 2.. 1.. BOOM!"), - _G("I'm history"), - _G("I'm going down"), - _G("I smell a rat") + N_("Ooops!"), + N_("Aieeeee!!"), + N_("Ouch!"), + N_("Houston, we have a problem"), + N_("3.. 2.. 1.. BOOM!"), + N_("I'm history"), + N_("I'm going down"), + N_("I smell a rat") }; #define NMSGS (sizeof(messages) / sizeof(char *)) @@ -139,7 +141,7 @@ void mdvi_crash(const char *format, ...) va_start(ap, format); fprintf(stderr, "%s: %s: ", program_name, - gettext(messages[(int)time(NULL) % NMSGS])); + _(messages[(int)time(NULL) % NMSGS])); vfprintf(stderr, format, ap); #ifndef __GNUC__ /* let's be portable */ diff --git a/configure.ac b/configure.ac index 096fce8e..05ac3a24 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,7 @@ dnl Check dependencies AC_SEARCH_LIBS([hypot],[m]) +PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED) PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED) PKG_CHECK_MODULES(LIBVIEW, gtk+-3.0 >= $GTK_REQUIRED gail-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED) PKG_CHECK_MODULES(BACKEND, cairo >= $CAIRO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED) @@ -120,6 +121,9 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED) PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0 x11]) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + # *************** # Build utilities # *************** diff --git a/po/POTFILES.in b/po/POTFILES.in index f4395b52..02b9435c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -6,6 +6,21 @@ backend/djvu/djvu-document.c backend/djvu/djvudocument.atril-backend.desktop.in backend/dvi/dvi-document.c backend/dvi/dvidocument.atril-backend.desktop.in +backend/dvi/mdvi-lib/dviread.c +backend/dvi/mdvi-lib/font.c +backend/dvi/mdvi-lib/fontmap.c +backend/dvi/mdvi-lib/gf.c +backend/dvi/mdvi-lib/pagesel.c +backend/dvi/mdvi-lib/paper.c +backend/dvi/mdvi-lib/pk.c +backend/dvi/mdvi-lib/special.c +backend/dvi/mdvi-lib/sp-epsf.c +backend/dvi/mdvi-lib/t1.c +backend/dvi/mdvi-lib/tfm.c +backend/dvi/mdvi-lib/tfmfile.c +backend/dvi/mdvi-lib/tt.c +backend/dvi/mdvi-lib/util.c +backend/dvi/mdvi-lib/vf.c backend/epub/epub-document.c backend/epub/epubdocument.atril-backend.desktop.in backend/pdf/ev-poppler.cc |