Commit 139ef5a0 authored by Volker Krause's avatar Volker Krause
Browse files

Fix setting translation domain on the Grantlee localizer

Summary:
GrantleeTheme::Engine::localizer is a factory function, so calling
methods on a temporary returned by it has no effect.

Reviewers: aacid, mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D27443
parent 490d3591
......@@ -157,9 +157,12 @@ Grantlee::Template MessagePartRendererManager::loadByName(const QString &name)
Grantlee::Context MessagePartRendererManager::createContext()
{
Grantlee::Context c;
m_engine->localizer()->setApplicationDomain(QByteArrayLiteral("libmessageviewer"));
c.setLocalizer(m_engine->localizer());
// careful, m_engine->localizer() is actually a factory function!
auto localizer = m_engine->localizer();
localizer->setApplicationDomain(QByteArrayLiteral("libmessageviewer"));
c.setLocalizer(localizer);
c.insert(QStringLiteral("global"), m_globalContext);
return c;
}
......
Markdown is supported
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