Make the button tooltips on the "Configure Virtual Desktops" page translatable
AbandonedPublic

Authored by yurchor on Feb 8 2019, 7:27 AM.

Details

Reviewers
davidedmundson
Group Reviewers
KWin
Localization
Summary

There were reports that the tooltips are untranslated

KWin KCM 5.15 (Russian locale):

Test Plan

Open the KWin KCM in some non-en locale and hover the mouse pointer over the pencil or minus button at the right. Not tested by myself.

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8015
Build 8033: arc lint + arc unit
yurchor created this revision.Feb 8 2019, 7:27 AM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 8 2019, 7:27 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
yurchor requested review of this revision.Feb 8 2019, 7:27 AM
yurchor edited the summary of this revision. (Show Details)Feb 8 2019, 7:30 AM
pino added a subscriber: pino.Feb 8 2019, 7:31 AM

Please leave the existing context, so there is no string change, and this can be fixed in stable branches (in case it applies there).

yurchor updated this revision to Diff 51148.Feb 8 2019, 7:37 AM

Keep the context intact

broulik added a subscriber: broulik.Feb 8 2019, 7:45 AM

Why is this neccessary? The other places work just fine without a domain

Why is this neccessary? The other places work just fine without a domain

I was sure that it is not because the "Add" button translation below "just works". But the reporter insists that it does not work otherwise. Translation black magic...

I cannot test by myself because KWin from git/master does not compile on my KF 5.54. Can somebody test it?

ngraham added a subscriber: ngraham.Feb 8 2019, 4:24 PM

I'm also not sure why the change would be necessary, but it seems harmless enough to add the domain.

davidedmundson requested changes to this revision.Feb 8 2019, 4:32 PM
davidedmundson added a subscriber: davidedmundson.

, but it seems harmless enough to add the domain.

It might be harmless, but if there is a bug it needs to be identified and understood.

This revision now requires changes to proceed.Feb 8 2019, 4:32 PM
victorr added a subscriber: victorr.Feb 8 2019, 6:21 PM

After changing the lines to
i18ndc("kcm_kwin_virtualdesktops", "@info:tooltip", "Remove")
i18ndc("kcm_kwin_virtualdesktops", "@info:tooltip", "Rename")
translation works

aacid added subscribers: mart, aacid.Feb 8 2019, 8:31 PM

There are three KDeclarative with their three KLocalizedContexts being created when "executing" this QML file.

Only one of them has a call to setDomainTranslation, the other two are "outside" main.qml so don't get that call, that's fine.

I think the problem lies in kirigami's DelegateRecycler that is using the wrong context and thus the wrong translation domain for those i18nc calls.

In fact commenting out these lines

if (QQmlEngine *eng = qmlEngine(this)) {
    //share context object in order to never lose track of global i18n()
    ctx->setContextObject(eng->rootContext()->contextObject());
}

fixes the problem, which makes sense because it stops using the global i18n and uses the "correct" i18n. the question is what bug was those lines supposed to fix.

@mart any idea?

yurchor abandoned this revision.Feb 19 2019, 5:54 AM

Abandoned in favor of D19135

This comment was removed by victorr.