Load config i18n domain from applet root path

This now matches AppletQuickItem

BUG: 343932
Change-Id: Ia019ea45d61ec7ae6a8ae6ea83ea757804649b1a
Reviewed-by: David Edmundson
This commit is contained in:
Lasse Liehu 2015-02-16 19:09:44 +01:00 committed by David Edmundson
parent b3f607ec1a
commit edc767740e

View File

@ -88,7 +88,12 @@ void ConfigViewPrivate::init()
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(q->engine());
kdeclarative.setTranslationDomain("plasma_applet_" + applet.data()->pluginInfo().pluginName());
const QString rootPath = applet.data()->pluginInfo().property("X-Plasma-RootPath").toString();
if (!rootPath.isEmpty()) {
kdeclarative.setTranslationDomain("plasma_applet_" + rootPath);
} else {
kdeclarative.setTranslationDomain("plasma_applet_" + applet.data()->pluginInfo().pluginName());
}
kdeclarative.setupBindings();
qmlRegisterType<ConfigModel>("org.kde.plasma.configuration", 2, 0, "ConfigModel");
qmlRegisterType<ConfigCategory>("org.kde.plasma.configuration", 2, 0, "ConfigCategory");