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

Authored by yurchor on Fri, Feb 8, 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.Fri, Feb 8, 7:27 AM
Restricted Application added a project: KWin. · View Herald TranscriptFri, Feb 8, 7:27 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
yurchor requested review of this revision.Fri, Feb 8, 7:27 AM
yurchor edited the summary of this revision. (Show Details)Fri, Feb 8, 7:30 AM
pino added a subscriber: pino.Fri, Feb 8, 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.Fri, Feb 8, 7:37 AM

Keep the context intact

broulik added a subscriber: broulik.Fri, Feb 8, 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.Fri, Feb 8, 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.Fri, Feb 8, 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.Fri, Feb 8, 4:32 PM
victorr added a subscriber: victorr.Fri, Feb 8, 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.Fri, Feb 8, 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.Tue, Feb 19, 5:54 AM

Abandoned in favor of D19135