From 3a0f61b5591de86c57ce889bbd9564e80b139f7f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 11 Jul 2017 13:18:31 +0100 Subject: [PATCH] Load translations from KPackage files if bundled Test Plan: Installed battery monitor locally with kpackagetool5 -i moved x-test .po file from being installed systemwide to only being inside the bundle still get xx everywhere BUG: 374825 Reviewers: #plasma, mart Reviewed By: mart Subscribers: plasma-devel, #frameworks Tags: #plasma, #frameworks Differential Revision: https://phabricator.kde.org/D5209 --- src/plasma/pluginloader.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp index 6f8b13ebe..5a1369e9e 100644 --- a/src/plasma/pluginloader.cpp +++ b/src/plasma/pluginloader.cpp @@ -220,13 +220,17 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari allArgs << p.metadata().fileName() << appletId << args; if (p.metadata().serviceTypes().contains(QStringLiteral("Plasma/Containment"))) { - return new Containment(0, allArgs); + applet = new Containment(0, allArgs); } else { - return new Applet(0, allArgs); + applet = new Applet(0, allArgs); } } + const QString localePath = p.filePath("translations"); + if (!localePath.isEmpty()) { + KLocalizedString::addDomainLocaleDir(QByteArray("plasma_applet_") + name.toLatin1(), localePath); + } return applet; }