use the X-Plasma-RootPath property as default catalog

if X-Plasma-RootPath is set, use that instead of the plugin name as
default translation domain.
if an applet uses the package of another one, of course it has to use its
translation catalog as well

Change-Id: Ia23b261f449a560c3da19bc074e521139ae942c8
reviewed-by:Eike Hein <hein@kde.org>
This commit is contained in:
Marco Martin 2015-02-11 16:40:52 +01:00
parent e0f6b76f4b
commit 9c855f05ab

View File

@ -381,7 +381,12 @@ AppletQuickItem::AppletQuickItem(Plasma::Applet *applet, QQuickItem *parent)
d->qmlObject = new KDeclarative::QmlObject(this);
if (applet->pluginInfo().isValid()) {
d->qmlObject->setTranslationDomain("plasma_applet_" + applet->pluginInfo().pluginName());
const QString rootPath = applet->pluginInfo().property("X-Plasma-RootPath").toString();
if (!rootPath.isEmpty()) {
d->qmlObject->setTranslationDomain("plasma_applet_" + rootPath);
} else {
d->qmlObject->setTranslationDomain("plasma_applet_" + applet->pluginInfo().pluginName());
}
}
d->qmlObject->setInitializationDelayed(true);