mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 18:24:48 +00:00
* 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
This commit is contained in:
parent
9479b1323f
commit
3db3cc44dd
@ -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]
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user