translate properly qt built-in text

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8875 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2004-08-08 22:37:39 +00:00
parent 6ce3792cd7
commit f28f5b4a08
3 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2004-08-08 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* Makefile.am (AM_CXXFLAGS): do not disable QTranslator code
* lyx_gui.C (parse_init): install a translator for Qt native
strings.
2004-08-07 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* QBibtexDialog.C (browsePressed): use ControlBibtex::browseBst

View File

@ -14,7 +14,7 @@ noinst_LTLIBRARIES = libqt2.la
libqt2_la_LDFLAGS = $(QT_LDFLAGS)
libqt2_la_LIBADD = $(QT_LIB) ui/*.lo moc/*.lo ui/moc/*.lo
AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_TRANSLATION
AM_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR
libqt2_la_SOURCES = \
QDialogView.C \

View File

@ -29,6 +29,7 @@
#include "support/lstrings.h"
#include "support/os.h"
#include "debug.h"
// Dear Lord, deliver us from Evil, aka the Qt headers
// Qt defines a macro 'signals' that clashes with a boost namespace.
@ -50,6 +51,8 @@
#include <qapplication.h>
#include <qpaintdevicemetrics.h>
#include <qtranslator.h>
#include <qtextcodec.h>
using lyx::support::ltrim;
@ -152,7 +155,25 @@ bool use_gui = true;
void parse_init(int & argc, char * argv[])
{
static LQApplication a(argc, argv);
static LQApplication app(argc, argv);
#if QT_VERSION >= 0x030200
// install translation file for Qt built-in dialogs
// These are only installed since Qt 3.2.x
static QTranslator qt_trans(0);
if (qt_trans.load(QString("qt_") + QTextCodec::locale(),
qInstallPathTranslations())) {
app.installTranslator(&qt_trans);
// even if the language calls for RtL, don't do that
app.setReverseLayout(false);
lyxerr[Debug::GUI]
<< "Successfully installed Qt translations for locale "
<< QTextCodec::locale() << std::endl;
} else
lyxerr[Debug::GUI]
<< "Could not find Qt translations for locale "
<< QTextCodec::locale() << std::endl;
#endif
using namespace lyx::graphics;