]> git.lyx.org Git - lyx.git/commitdiff
* GuiApplication.C (GuiApplication): make sure that the Qtranslator
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Jan 2007 11:05:57 +0000 (11:05 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 4 Jan 2007 11:05:57 +0000 (11:05 +0000)
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
src/frontends/qt4/GuiApplication.h

index b97e7bc5beaaab1f39f627ac905cf5fc0b7762df..b2d6c6dabd2f8e62928095bb2eb4a91e80dee3f7 100644 (file)
@@ -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]
index b22f6bcf0b1667300ddf6374db9c5cb8486d4610..9e09335f5585677dc669f6cdffffca0af53a24be 100644 (file)
@@ -22,6 +22,7 @@
 #include "frontends/Application.h"
 
 #include <QApplication>
+#include <QTranslator>
 
 namespace lyx {
 
@@ -92,6 +93,8 @@ private:
        ///
        ColorCache color_cache_;
        ///
+       QTranslator qt_trans_;
+       ///
        std::map<int, boost::shared_ptr<socket_callback> > socket_callbacks_;
 
 #ifdef Q_WS_X11