Tooltips will automatically change with changes to shorcuts.
Ref T199
BUG: 348626
dkazakov | |
rempt | |
kossebau |
Tooltips will automatically change with changes to shorcuts.
Ref T199
BUG: 348626
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
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.
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());
If you could update the translation bit follwoing Alexander's suggestion, I'd say, it's good to go.