From 3db3cc44dd6862e3fed1b4ed7f84f060a98101d3 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 4 Jan 2007 11:05:57 +0000 Subject: [PATCH] * GuiApplication.C (GuiApplication): make sure that the Qtranslator holding the Qt translations is not deleted. Now keyboard shortcuts and Qt stock dialogs are properly translated. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16496 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.C | 5 ++--- src/frontends/qt4/GuiApplication.h | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.C b/src/frontends/qt4/GuiApplication.C index b97e7bc5be..b2d6c6dabd 100644 --- a/src/frontends/qt4/GuiApplication.C +++ b/src/frontends/qt4/GuiApplication.C @@ -107,13 +107,12 @@ GuiApplication::GuiApplication(int & argc, char ** argv) #endif // install translation file for Qt built-in dialogs - QTranslator qt_trans; QString language_name = QString("qt_") + QLocale::system().name(); language_name.truncate(5); - if (qt_trans.load(language_name, + if (qt_trans_.load(language_name, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { - qApp->installTranslator(&qt_trans); + qApp->installTranslator(&qt_trans_); // even if the language calls for RtL, don't do that qApp->setLayoutDirection(Qt::LeftToRight); lyxerr[Debug::GUI] diff --git a/src/frontends/qt4/GuiApplication.h b/src/frontends/qt4/GuiApplication.h index b22f6bcf0b..9e09335f55 100644 --- a/src/frontends/qt4/GuiApplication.h +++ b/src/frontends/qt4/GuiApplication.h @@ -22,6 +22,7 @@ #include "frontends/Application.h" #include +#include namespace lyx { @@ -92,6 +93,8 @@ private: /// ColorCache color_cache_; /// + QTranslator qt_trans_; + /// std::map > socket_callbacks_; #ifdef Q_WS_X11