mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-21 17:52:11 +01:00
Optimize for size rather than speed by making _() always call
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com> * gutils.c glibintl.h: Optimize for size rather than speed by making _() always call _glib_gettext() instead of conditionally calling gettext() or _glib_gettext_init. glib only uses translated strings in slow error handling code anyways. * glibintl.h: g'ify types. * Makefile.am: include glibintl.h in _SOURCES
This commit is contained in:
parent
a9d05d4cc4
commit
ff51072d50
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
Tue Jan 16 23:20:38 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gutils.c glibintl.h: Optimize for size rather than speed by
|
||||||
|
making _() always call _glib_gettext() instead of conditionally
|
||||||
|
calling gettext() or _glib_gettext_init. glib only uses translated
|
||||||
|
strings in slow error handling code anyways.
|
||||||
|
|
||||||
|
* glibintl.h: g'ify types.
|
||||||
|
|
||||||
|
* Makefile.am: include glibintl.h in _SOURCES
|
||||||
|
|
||||||
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
2001-01-17 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
* config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
|
||||||
|
@ -58,6 +58,7 @@ libglib_1_3_la_SOURCES = \
|
|||||||
ghook.c \
|
ghook.c \
|
||||||
giochannel.c \
|
giochannel.c \
|
||||||
giounix.c \
|
giounix.c \
|
||||||
|
glibintl.h \
|
||||||
glist.c \
|
glist.c \
|
||||||
gmain.c \
|
gmain.c \
|
||||||
gmarkup.c \
|
gmarkup.c \
|
||||||
|
@ -58,6 +58,7 @@ libglib_1_3_la_SOURCES = \
|
|||||||
ghook.c \
|
ghook.c \
|
||||||
giochannel.c \
|
giochannel.c \
|
||||||
giounix.c \
|
giounix.c \
|
||||||
|
glibintl.h \
|
||||||
glist.c \
|
glist.c \
|
||||||
gmain.c \
|
gmain.c \
|
||||||
gmarkup.c \
|
gmarkup.c \
|
||||||
|
@ -5,15 +5,10 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
|
|
||||||
extern int _glib_gettext_initialized;
|
gchar *_glib_gettext (const gchar *str);
|
||||||
|
|
||||||
char *_glib_gettext_init (const char *str);
|
#include <libintl.h>
|
||||||
|
#define _(String) _glib_gettext(String)
|
||||||
#include<libintl.h>
|
|
||||||
#define _(String) \
|
|
||||||
(_glib_gettext_initialized ? \
|
|
||||||
dgettext(GETTEXT_PACKAGE,String) : \
|
|
||||||
_glib_gettext_init(String))
|
|
||||||
|
|
||||||
#ifdef gettext_noop
|
#ifdef gettext_noop
|
||||||
#define N_(String) gettext_noop(String)
|
#define N_(String) gettext_noop(String)
|
||||||
|
@ -1006,20 +1006,27 @@ g_get_codeset (void)
|
|||||||
|
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
|
|
||||||
#define GLIB_LOCALE_DIR \
|
#define GLIB_LOCALE_DIR \
|
||||||
g_strconcat (g_win32_get_package_installation_directory (GETTEXT_PACKAGE), \
|
g_strconcat (g_win32_get_package_installation_directory (GETTEXT_PACKAGE), \
|
||||||
G_DIR_SEPARATOR_S, \
|
G_DIR_SEPARATOR_S, \
|
||||||
"locale", \
|
"locale", \
|
||||||
NULL)
|
NULL)
|
||||||
#endif
|
|
||||||
|
|
||||||
int _glib_gettext_initialized = 0;
|
#endif /* G_OS_WIN32 */
|
||||||
|
|
||||||
char *_glib_gettext_init (const char *str)
|
gchar *
|
||||||
|
_glib_gettext (const gchar *str)
|
||||||
{
|
{
|
||||||
bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
|
gboolean _glib_gettext_initialized = FALSE;
|
||||||
|
|
||||||
|
if (!_glib_gettext_initialized)
|
||||||
|
{
|
||||||
|
bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
|
||||||
|
_glib_gettext_initialized = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return dgettext (GETTEXT_PACKAGE, str);
|
return dgettext (GETTEXT_PACKAGE, str);
|
||||||
}
|
}
|
||||||
|
11
glibintl.h
11
glibintl.h
@ -5,15 +5,10 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
|
|
||||||
extern int _glib_gettext_initialized;
|
gchar *_glib_gettext (const gchar *str);
|
||||||
|
|
||||||
char *_glib_gettext_init (const char *str);
|
#include <libintl.h>
|
||||||
|
#define _(String) _glib_gettext(String)
|
||||||
#include<libintl.h>
|
|
||||||
#define _(String) \
|
|
||||||
(_glib_gettext_initialized ? \
|
|
||||||
dgettext(GETTEXT_PACKAGE,String) : \
|
|
||||||
_glib_gettext_init(String))
|
|
||||||
|
|
||||||
#ifdef gettext_noop
|
#ifdef gettext_noop
|
||||||
#define N_(String) gettext_noop(String)
|
#define N_(String) gettext_noop(String)
|
||||||
|
17
gutils.c
17
gutils.c
@ -1006,20 +1006,27 @@ g_get_codeset (void)
|
|||||||
|
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
|
|
||||||
#define GLIB_LOCALE_DIR \
|
#define GLIB_LOCALE_DIR \
|
||||||
g_strconcat (g_win32_get_package_installation_directory (GETTEXT_PACKAGE), \
|
g_strconcat (g_win32_get_package_installation_directory (GETTEXT_PACKAGE), \
|
||||||
G_DIR_SEPARATOR_S, \
|
G_DIR_SEPARATOR_S, \
|
||||||
"locale", \
|
"locale", \
|
||||||
NULL)
|
NULL)
|
||||||
#endif
|
|
||||||
|
|
||||||
int _glib_gettext_initialized = 0;
|
#endif /* G_OS_WIN32 */
|
||||||
|
|
||||||
char *_glib_gettext_init (const char *str)
|
gchar *
|
||||||
|
_glib_gettext (const gchar *str)
|
||||||
{
|
{
|
||||||
bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
|
gboolean _glib_gettext_initialized = FALSE;
|
||||||
|
|
||||||
|
if (!_glib_gettext_initialized)
|
||||||
|
{
|
||||||
|
bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
|
||||||
|
_glib_gettext_initialized = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return dgettext (GETTEXT_PACKAGE, str);
|
return dgettext (GETTEXT_PACKAGE, str);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user