Update tooltips to include keyboard shortcut.
ClosedPublic

Authored by abrahams on Aug 16 2015, 6:08 PM.

Details

Summary

Tooltips will automatically change with changes to shorcuts.

Ref T199
BUG: 348626

Diff Detail

Repository
R8 Calligra
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
abrahams updated this revision to Diff 555.Aug 16 2015, 6:08 PM
abrahams retitled this revision from to Update tooltips to include keyboard shortcut..
abrahams updated this object.
abrahams edited the test plan for this revision. (Show Details)
abrahams added reviewers: dkazakov, rempt.
abrahams added a task: Restricted Maniphest Task.
abrahams updated this revision to Diff 558.Aug 16 2015, 8:15 PM

Rebased onto today's patches

rempt accepted this revision.Aug 17 2015, 7:31 AM
rempt edited edge metadata.

I wonder if there are languages where "tool name (shortcut)" should be ":(shortcut) tool name", so we'd need an i18nc with appropriate comment in the tooltip string.

This revision is now accepted and ready to land.Aug 17 2015, 7:31 AM

That's a good point. I can push first, or wait until setting up the archive.

rempt added a comment.Aug 17 2015, 8:42 AM

I'll try and get input from a translator.

2015-08-17 11:48 GMT+03:00 Boudewijn Rempt <boud@valdyas.org>:

Hi Alexander!

Could you take a look at https://phabricator.kde.org/D245 ? I'm wondering
how to make the "tool (shortcut)" string properly translatable. See:

QString ToolHelper::buttonToolTip() const
{

return shortcut().isEmpty() ?
    toolTip() :
    QString("%1 (%2)").arg(toolTip()).arg(shortcut().toString());

}

Hi Boud,

You just need to wrap "%1 (%2)" in i18n(), I would do it like this:

return shortcut().isEmpty() ?
    i18nc("@info:tooltip", "%1", toolTip()) :
    i18nc("@info:tooltip %2 is shortcut", "%1 (%2)", toolTip(),

shortcut().toString());

rempt added a comment.Aug 18 2015, 1:05 PM

If you could update the translation bit follwoing Alexander's suggestion, I'd say, it's good to go.

This revision was automatically updated to reflect the committed changes.