mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
gettext cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1715 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
de26c5e188
commit
7d09a8c0e7
@ -1,3 +1,7 @@
|
|||||||
|
2001-03-08 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
|
* INSTALL: remove mention of problem with gettext.
|
||||||
|
|
||||||
2001-03-02 John Levon <moz@compsoc.man.ac.uk>
|
2001-03-02 John Levon <moz@compsoc.man.ac.uk>
|
||||||
|
|
||||||
* configure.in:
|
* configure.in:
|
||||||
|
10
INSTALL
10
INSTALL
@ -325,16 +325,6 @@ notify us.
|
|||||||
If you your version of gcc-c++ is > 2.96-69, you may not need to do
|
If you your version of gcc-c++ is > 2.96-69, you may not need to do
|
||||||
this.
|
this.
|
||||||
|
|
||||||
o If you have GNU gettext installed on your system (e.g. on linux),
|
|
||||||
you may get tons of warnings like:
|
|
||||||
|
|
||||||
bullet_forms.C:101: warning: passing `char *' to argument 1 of
|
|
||||||
`__builtin_constant_p(int)' lacks a cast
|
|
||||||
|
|
||||||
These are in harmless warnings caused by a bug in libintl.h, but
|
|
||||||
will be solved if you use --with-included-gettext when configuring
|
|
||||||
LyX.
|
|
||||||
|
|
||||||
o It is possible to compile lyx with Tru64 Unix cxx compiler
|
o It is possible to compile lyx with Tru64 Unix cxx compiler
|
||||||
version 6.2, provided one uses
|
version 6.2, provided one uses
|
||||||
CXX='cxx -std strict_ansi'
|
CXX='cxx -std strict_ansi'
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
2001-03-08 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
|
* main.C (main): pass lyx_localedir to gettext_init().
|
||||||
|
|
||||||
|
* gettext.h: remove locale_init and gettext_init macros
|
||||||
|
|
||||||
|
* gettext.C (locale_init): new function
|
||||||
|
(gettext_init): new function
|
||||||
|
|
||||||
|
* lyx_gui.C (LyXGUI): use locale_init() instead of explicit
|
||||||
|
setlocale().
|
||||||
|
|
||||||
2001-03-07 Edwin Leuven <leuven@fee.uva.nl>
|
2001-03-07 Edwin Leuven <leuven@fee.uva.nl>
|
||||||
|
|
||||||
* Moved credits to frontends:
|
* Moved credits to frontends:
|
||||||
|
@ -1,10 +1,29 @@
|
|||||||
|
// -*- C++ -*-
|
||||||
|
/* This file is part of
|
||||||
|
* ======================================================
|
||||||
|
*
|
||||||
|
* LyX, The Document Processor
|
||||||
|
*
|
||||||
|
* Copyright 1995 Matthias Ettrich
|
||||||
|
* Copyright 1995-2001 The LyX Team.
|
||||||
|
*
|
||||||
|
* ====================================================== */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include "LString.h"
|
|
||||||
#include "gettext.h"
|
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
|
|
||||||
|
#include "LString.h"
|
||||||
|
|
||||||
|
# if HAVE_GETTEXT
|
||||||
|
# include <libintl.h> // use the header already in the system *EK*
|
||||||
|
# ifdef HAVE_LOCALE_H
|
||||||
|
# include <locale.h> // for LC_MESSAGES
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# include "../intl/libintl.h"
|
||||||
|
# endif
|
||||||
|
|
||||||
char const * _(char const * str)
|
char const * _(char const * str)
|
||||||
{
|
{
|
||||||
// I'd rather have an Assert on str, we should not allow
|
// I'd rather have an Assert on str, we should not allow
|
||||||
@ -32,4 +51,20 @@ string const _(string const & str)
|
|||||||
return string();
|
return string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void locale_init()
|
||||||
|
{
|
||||||
|
# ifdef HAVE_LC_MESSAGES
|
||||||
|
setlocale(LC_MESSAGES, "");
|
||||||
|
setlocale(LC_CTYPE, "");
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void gettext_init(string const & localedir)
|
||||||
|
{
|
||||||
|
bindtextdomain(PACKAGE, localedir.c_str());
|
||||||
|
textdomain(PACKAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,41 +34,27 @@
|
|||||||
|
|
||||||
#include "LString.h"
|
#include "LString.h"
|
||||||
|
|
||||||
# if HAVE_GETTEXT
|
///
|
||||||
# include <libintl.h> // use the header already in the system *EK*
|
|
||||||
# ifdef HAVE_LOCALE_H
|
|
||||||
# include <locale.h> // for LC_MESSAGES
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# include "../intl/libintl.h"
|
|
||||||
# endif
|
|
||||||
|
|
||||||
char const * _(char const *);
|
char const * _(char const *);
|
||||||
|
///
|
||||||
string const _(string const &);
|
string const _(string const &);
|
||||||
|
///
|
||||||
|
void locale_init();
|
||||||
|
///
|
||||||
|
void gettext_init(string const & localedir);
|
||||||
|
|
||||||
//# define _(str) gettext(str)
|
|
||||||
# define N_(str) (str) // for detecting static strings
|
|
||||||
|
|
||||||
# ifdef HAVE_LC_MESSAGES
|
|
||||||
// LC_TIME, LC_CTYPE, even LC_ALL
|
|
||||||
# define locale_init() { setlocale (LC_MESSAGES, ""); setlocale (LC_CTYPE, ""); setlocale(LC_NUMERIC, "C"); }
|
|
||||||
# else
|
|
||||||
# define locale_init()
|
|
||||||
# endif
|
|
||||||
# define gettext_init() { bindtextdomain (PACKAGE, lyx_localedir.c_str()); \
|
|
||||||
textdomain (PACKAGE); }
|
|
||||||
#else
|
#else
|
||||||
///
|
///
|
||||||
# define _(str) (str)
|
# define _(str) (str)
|
||||||
///
|
///
|
||||||
# define S_(str) (str)
|
# define S_(str) (str)
|
||||||
///
|
///
|
||||||
# define N_(str) (str)
|
|
||||||
///
|
|
||||||
# define locale_init()
|
# define locale_init()
|
||||||
///
|
///
|
||||||
# define gettext_init()
|
# define gettext_init(package, localedir)
|
||||||
#endif
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# define N_(str) (str) // for detecting static strings
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <clocale>
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation
|
#pragma implementation
|
||||||
@ -103,7 +102,7 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
|
|||||||
fl_initialize(argc, argv, "LyX", cmdopt, num_res);
|
fl_initialize(argc, argv, "LyX", cmdopt, num_res);
|
||||||
// It appears that, in xforms >=0.89.5, fl_initialize()
|
// It appears that, in xforms >=0.89.5, fl_initialize()
|
||||||
// calls setlocale() and ruins our LC_NUMERIC setting.
|
// calls setlocale() and ruins our LC_NUMERIC setting.
|
||||||
setlocale(LC_NUMERIC, "C");
|
locale_init();
|
||||||
fl_get_app_resources(res, num_res);
|
fl_get_app_resources(res, num_res);
|
||||||
|
|
||||||
static const int geometryBitmask =
|
static const int geometryBitmask =
|
||||||
|
@ -30,8 +30,8 @@ int main(int argc, char * argv[])
|
|||||||
lyx_localedir = LOCALEDIR;
|
lyx_localedir = LOCALEDIR;
|
||||||
|
|
||||||
// initialize for internationalized version *EK*
|
// initialize for internationalized version *EK*
|
||||||
locale_init(); // macro
|
locale_init();
|
||||||
gettext_init(); // macro
|
gettext_init(lyx_localedir);
|
||||||
|
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
_wildcard(&argc, &argv);
|
_wildcard(&argc, &argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user