diff options
authorMartin Gräßlin <>2017-01-22 10:55:33 (GMT)
committerMartin Gräßlin <>2017-01-22 11:00:13 (GMT)
commita3be3e8e80b68c8e8ae93034aeb139df0ad7055a (patch)
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:
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 <>.
#include <KScreenLocker/KsldApp>
// Frameworks
#include <KKeyServer>
+#include <KLocalizedString>
#include <KGlobalAccel>
// Qt
#include <QDBusConnection>
@@ -385,7 +386,7 @@ void Xkb::updateModifiers()
- msg << QString::fromLocal8Bit(xkb_keymap_layout_get_name(m_keymap, layout));
+ msg << i18nd("xkeyboard-config", xkb_keymap_layout_get_name(m_keymap, layout));