Commit 37792755 authored by Zren (Chris Holland)'s avatar Zren (Chris Holland)
Browse files

[plasmoidviewer] Load translations from KPackage files if bundled

Based on D5209, which adds this feature to plasma-framework.

Differential Revision: https://phabricator.kde.org/D10219
parent 359522ac
......@@ -103,6 +103,14 @@ void View::addApplet(const QString &applet)
a = containment()->createApplet(applet);
} else {
a = Plasma::Applet::loadPlasmoid(metadataPath);
// Load translations from KPackage files if bundled
const QString localePath = a->kPackage().filePath("translations");
if (!localePath.isEmpty()) {
const QString localeDomain = QByteArray("plasma_applet_") + a->pluginMetaData().pluginId();
KLocalizedString::addDomainLocaleDir(localeDomain.toLatin1(), localePath);
}
containment()->addApplet(a);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment