diff options
Diffstat (limited to 'src/plugins/qmlpreview/qmlpreviewplugin.cpp')
-rw-r--r-- | src/plugins/qmlpreview/qmlpreviewplugin.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index b578be4ac0..72927f8cdf 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -193,7 +193,10 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent) action->setEnabled(SessionManager::startupProject() != nullptr); connect(SessionManager::instance(), &SessionManager::startupProjectChanged, action, &QAction::setEnabled); - connect(action, &QAction::triggered, this, []() { + connect(action, &QAction::triggered, this, [this]() { + if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current()) + m_locale = multiLanguageAspect->currentLocale(); + ProjectExplorerPlugin::runStartupProject(Constants::QML_PREVIEW_RUN_MODE); }); menu->addAction(Core::ActionManager::registerAction(action, "QmlPreview.Internal"), @@ -334,6 +337,8 @@ QString QmlPreviewPlugin::locale() const void QmlPreviewPlugin::setLocale(const QString &locale) { + if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current()) + multiLanguageAspect->setCurrentLocale(locale); if (d->m_locale == locale) return; |