summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2017-01-22 10:55:33 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2017-01-22 11:00:13 (GMT)
commita3be3e8e80b68c8e8ae93034aeb139df0ad7055a (patch)
treea35214e4e17c4ecb8120a391f50d80efa5c365a6
parent0acfebd96bace0fefd7c4291617f1d07f96ca03e (diff)
Translate the layout name when passing to layout change OSD
Summary: Xkbcommon does not localize the layout names. We always get the US English variant. KWin so far passed the strings from xkbcommon directly to UI visible parts such as the Plasma OSD. This results in not translated elements in our UI. As I figured out today the translations exist in the domain xkeyboard-config. Passing the strings from xkbcommon through this domain gives us translated layouts. Unfortunately the xkeyboard-config is not installed by default on all distributions. E.g. on ubuntu/neon one needs to install xkb-data-i18n to have the translations available. Test Plan: Untested as I fail to start Plasma/5.8 KWin on my dev system Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D4243
-rw-r--r--keyboard_input.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/keyboard_input.cpp b/keyboard_input.cpp
index bb6b377..9a1c3f4 100644
--- a/keyboard_input.cpp
+++ b/keyboard_input.cpp
@@ -33,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KScreenLocker/KsldApp>
// Frameworks
#include <KKeyServer>
+#include <KLocalizedString>
#include <KGlobalAccel>
// Qt
#include <QDBusConnection>
@@ -385,7 +386,7 @@ void Xkb::updateModifiers()
QStringLiteral("org.kde.osdService"),
QStringLiteral("kbdLayoutChanged"));
- msg << QString::fromLocal8Bit(xkb_keymap_layout_get_name(m_keymap, layout));
+ msg << i18nd("xkeyboard-config", xkb_keymap_layout_get_name(m_keymap, layout));
QDBusConnection::sessionBus().asyncCall(msg);
}