removed INIT_LOCALE() macro. Error out if config.h wasn't included before.

2002-02-18  Sven Neumann  <sven@gimp.org>

	* 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.
This commit is contained in:
Sven Neumann 2002-02-18 17:42:17 +00:00 committed by Sven Neumann
parent bec4c72534
commit d3f6ad0968
5 changed files with 35 additions and 19 deletions

View File

@ -1,3 +1,14 @@
2002-02-18 Sven Neumann <sven@gimp.org>
* 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 <mitch@gimp.org>
* app/tools/tools-types.h

View File

@ -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++)

View File

@ -22,12 +22,14 @@
#ifndef __GIMPINTL_H__
#define __GIMPINTL_H__
#include <glib.h>
#ifndef GETTEXT_PACKAGE
#error "config.h must be included prior to gimpintl.h"
#endif
#include <locale.h>
/* Copied from gnome-i18n.h by Tom Tromey <tromey@creche.cygnus.com>
* Heavily modified by Daniel Egger <Daniel.Egger@t-online.de>
* So be sure to hit me instead of him if something is wrong here
* Modified by Daniel Egger <Daniel.Egger@t-online.de> 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__ */

View File

@ -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 <libintl.h>

View File

@ -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__ */