mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Set translation domain for quicksetting plugins
This commit is contained in:
parent
b0cda701c5
commit
4e1e9e8a9f
2 changed files with 7 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ target_link_libraries(quicksettingsplugin PRIVATE
|
|||
KF6::Service
|
||||
KF6::ConfigWidgets
|
||||
KF6::Package
|
||||
KF6::I18n
|
||||
)
|
||||
|
||||
ecm_finalize_qml_module(quicksettingsplugin)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include <QFileInfo>
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlEngine>
|
||||
#include <QQmlContext>
|
||||
#include <KLocalizedContext>
|
||||
|
||||
QuickSettingsModel::QuickSettingsModel(QObject *parent)
|
||||
: QAbstractListModel{parent}
|
||||
|
|
@ -79,7 +81,10 @@ void QuickSettingsModel::loadQuickSettings()
|
|||
|
||||
// load QML from kpackage
|
||||
c->loadUrl(package.fileUrl("mainscript"), QQmlComponent::PreferSynchronous);
|
||||
|
||||
KLocalizedContext *i18nContext = new KLocalizedContext(engine);
|
||||
i18nContext->setTranslationDomain(QLatin1String("plasma_") + metaData.pluginId());
|
||||
engine->rootContext()->setContextObject(i18nContext);
|
||||
|
||||
auto created = c->create(engine->rootContext());
|
||||
auto createdSetting = qobject_cast<QuickSetting *>(created);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue