Translate the layout name when passing to layout change OSD
ClosedPublic

Authored by graesslin on Jan 22 2017, 11:00 AM.

Details

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

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin retitled this revision from to Translate the layout name when passing to layout change OSD.Jan 22 2017, 11:00 AM
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptJan 22 2017, 11:00 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript

Screenshot of this change taken on current master.

bshah accepted this revision.Jan 22 2017, 11:34 AM
bshah added a reviewer: bshah.
bshah added a subscriber: bshah.

I assume that if translations are not installed, it still shows at least US English names..

This revision is now accepted and ready to land.Jan 22 2017, 11:34 AM

Can this be marked as runtime dep in CMake (not for 5.8 branch) to encourage distributions to provide this package by default?

In D4243#79207, @bshah wrote:

I assume that if translations are not installed, it still shows at least US English names..

Yes. It's like a not translated string

In D4243#79207, @bshah wrote:

I assume that if translations are not installed, it still shows at least US English names..

Yes. It's like a not translated string

Can this be marked as runtime dep in CMake (not for 5.8 branch) to encourage distributions to provide this package by default?

I don't know how we can check in cmake for translations. But I intend to send a mail to distro mailing list to remind them to install it. Also I reported a bug against neon today.

This revision was automatically updated to reflect the committed changes.