diff --git a/ChangeLog b/ChangeLog index f234d04797..6b15d319a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-02-18 Sven Neumann + + * libgimp/gimpintl.h: removed INIT_LOCALE() macro. Error out if + config.h wasn't included before. + + * app/main.c: directly call the appropriate functions to set up I18N. + + * libgimp/libgimp-intl.h: error out if config.h wasn't included. + + * plug-ins/script-fu/script-fu-intl.h: set codeset to UTF-8. + 2002-02-18 Michael Natterer * app/tools/tools-types.h diff --git a/app/main.c b/app/main.c index 7dfdb3c249..761da3c62b 100644 --- a/app/main.c +++ b/app/main.c @@ -116,11 +116,16 @@ main (int argc, prog_name = argv[0]; /* Initialize i18n support */ - INIT_LOCALE (GETTEXT_PACKAGE); -#ifdef ENABLE_NLS - bindtextdomain ("gimp-libgimp", LOCALEDIR); -#endif + setlocale (LC_ALL, ""); + + bindtextdomain (GETTEXT_PACKAGE"-libgimp", LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE"-libgimp", "UTF-8"); + + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + + textdomain (GETTEXT_PACKAGE); /* check argv[] for "--no-interface" before trying to initialize gtk+ */ for (i = 1; i < argc; i++) diff --git a/libgimp/gimpintl.h b/libgimp/gimpintl.h index 7be40d3394..4e12e55e60 100644 --- a/libgimp/gimpintl.h +++ b/libgimp/gimpintl.h @@ -22,12 +22,14 @@ #ifndef __GIMPINTL_H__ #define __GIMPINTL_H__ -#include +#ifndef GETTEXT_PACKAGE +#error "config.h must be included prior to gimpintl.h" +#endif + #include /* Copied from gnome-i18n.h by Tom Tromey - * Heavily modified by Daniel Egger - * So be sure to hit me instead of him if something is wrong here + * Modified by Daniel Egger and others. */ #ifndef LOCALEDIR @@ -60,11 +62,4 @@ # define bind_textdomain_codeset(Domain, Codeset) (Domain) #endif -#define INIT_LOCALE( domain ) G_STMT_START{ \ - setlocale (LC_ALL, ""); \ - bindtextdomain (domain, LOCALEDIR); \ - bind_textdomain_codeset (domain, "UTF-8"); \ - textdomain (domain); \ -}G_STMT_END - #endif /* __GIMPINTL_H__ */ diff --git a/libgimp/libgimp-intl.h b/libgimp/libgimp-intl.h index 85e63460aa..b500ca85ac 100644 --- a/libgimp/libgimp-intl.h +++ b/libgimp/libgimp-intl.h @@ -22,6 +22,9 @@ #ifndef __LIBGIMP_INTL_H__ #define __LIBGIMP_INTL_H__ +#ifndef GETTEXT_PACKAGE +#error "config.h must be included prior to libgimp-intl.h" +#endif #ifdef ENABLE_NLS # include diff --git a/plug-ins/script-fu/script-fu-intl.h b/plug-ins/script-fu/script-fu-intl.h index 0459f5b8b3..a698a29385 100644 --- a/plug-ins/script-fu/script-fu-intl.h +++ b/plug-ins/script-fu/script-fu-intl.h @@ -23,11 +23,13 @@ #include "libgimp/gimpintl.h" -#define INIT_I18N() G_STMT_START{ \ - setlocale (LC_ALL, ""); \ - bindtextdomain(GETTEXT_PACKAGE"-libgimp", LOCALEDIR); \ - bindtextdomain(GETTEXT_PACKAGE"-script-fu", LOCALEDIR); \ - textdomain(GETTEXT_PACKAGE"-script-fu"); \ +#define INIT_I18N() G_STMT_START{ \ + setlocale (LC_ALL, ""); \ + bindtextdomain(GETTEXT_PACKAGE"-libgimp", LOCALEDIR); \ + bind_textdomain_codeset (GETTEXT_PACKAGE"-libgimp", "UTF-8"); \ + bindtextdomain(GETTEXT_PACKAGE"-script-fu", LOCALEDIR); \ + bind_textdomain_codeset (GETTEXT_PACKAGE"-script-fu", "UTF-8"); \ + textdomain(GETTEXT_PACKAGE"-script-fu"); \ }G_STMT_END #endif /* __SCRIPT_FU_INTL_H__ */