Bug 151447 - Shortcut of "Home" key is displayed using i18n("Home") rather than i18nc("keyboard-key-name","Home")
Summary: Shortcut of "Home" key is displayed using i18n("Home") rather than i18nc("key...
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-28 00:07 UTC by Funda Wang
Modified: 2007-11-23 16:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
kshortcut-dialog-under-zh_CN-locale.png (37.69 KB, image/png)
2007-10-28 00:09 UTC, Funda Wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Funda Wang 2007-10-28 00:07:52 UTC
Version:           3.94 (using KDE Devel)
Installed from:    Compiled sources

Take konqueror as example.

Under default shortcut settings, Alt+Home means to go to homepage. But the word "Home" in menu is not displayed using translation from i18nc("keyboard-key-name","Home"), but just plain i18n("Home").

The same applies to kshortcut settings dialog.

Screenshot follows.
Comment 1 Funda Wang 2007-10-28 00:09:42 UTC
Created attachment 21926 [details]
kshortcut-dialog-under-zh_CN-locale.png

The certain translation of "Home" is just plain translation of i18n("Home"),
rather than i18nc("keyboard-key-name","Home").
Comment 2 David Faure 2007-11-23 13:02:52 UTC
Nice screenshot, doesn't tell me anything since I can't read chinese though :-)

I don't see i18n("Home") in kdelibs, so I think this translation comes from Qt.
Which makes it harder to change the tr call... but on the other hand, I would expect that Qt only cares about the keyboard thing so I would suggest to translate "Home" with the keyboard one, and see then ensure that the kde calls to i18n("Home") have proper context.

I see this in QTDIR/translations/qt_zh_CN.ts, but I'm not sure we even use those translations in kde? Do you have a qt.po or qt_messages.po maybe?
    <message>
        <location filename="../src/gui/kernel/qkeysequence.cpp" line="300"/>
        <source>Home</source>
        <translation>家</translation>
    </message>
Comment 3 Funda Wang 2007-11-23 14:04:38 UTC
I'm quite sure this translation is from KDE, especially in kdelibs4.po. I've done such test that replace "Home" with some strange characters, and it shows in the interface too.

I'm afarid you cannot just use `grep 'i18n("Home")' *.cpp`, because the dialog itself maybe built using i18n(mShortcut) or something like that.

Another things is "&None..." is not translated, as you can see in the screenshot. Please note that zh_CN has a nearly 100% translated kdelibs4.po, which includes "&None..." of course.

And, no matter you understand Chinese or not, you can test under xx locale, I think.
Comment 4 David Faure 2007-11-23 14:11:09 UTC
On Friday 23 November 2007, Funda Wang wrote:
>  i18n(mShortcut)

Then the string to translate would be marked with I18N_NOOP("Home") somewhere else, which I didn't find either.

> I'm quite sure this translation is from KDE, especially in kdelibs4.po.

The po files has a file and line number. Can you give those to me?
Comment 5 Funda Wang 2007-11-23 14:24:54 UTC
It looks very strange:

#: kfile/kfileplacesmodel.cpp:85
msgid "Home"

Maybe the shortcut keys are not makred with I18N_NOOP? They are just from xorg?
Comment 6 David Faure 2007-11-23 14:40:36 UTC
SVN commit 740549 by dfaure:

Give context to this "Home" translation so that it isn't mixed up with Qt's tr("Home") which is about the key shortcut.
BUG: 151447


 M  +1 -1      kfileplacesmodel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=740549
Comment 7 David Faure 2007-11-23 14:43:03 UTC
On Friday 23 November 2007, Funda Wang wrote:
> #: kfile/kfileplacesmodel.cpp:85
> msgid "Home"

Ah, didn't grep that directory, I thought it came from kdeui.

> Maybe the shortcut keys are not marked with I18N_NOOP? They are just from xorg?

No no, this is about Qt versus kdelibs. Qt uses "Home", in kdelibs we need to add context.
Comment 8 Funda Wang 2007-11-23 15:01:24 UTC
But why the "Default: Alt+Home" downstairs shows correctly?
Comment 9 David Faure 2007-11-23 16:02:32 UTC
On Friday 23 November 2007, Funda Wang wrote:
> But why the "Default: Alt+Home" downstairs shows correctly?

I _guess_ that this is because this conversion code is done by kdelibs/kdeui.
But please reopen this bug if the problem is still there after scripty updates kdelibs4.po
tomorrow and you change the translation of the "Home" with context.