Version: (using Devel) Installed from: Compiled sources OS: Linux In Bug 162209, SVN 825353, it is not acceptable that the change for "Strip ampersand characters from the text of standard top-level menu items". It's a "dirty" solution only for Western languages. In Western languages, the shortcut key should be "O" in "&Open", after your solution, "Open" is OK. But for East Asia languages, at least for us, Chinese(including simplified and traditional), Japanese and Korean should be same, it is not acceptable. We use "打开(&O)" for "&Open", after your solution, the users will confused about it, "打开(O)". It disables the shortcut key, but still displays the key for shortcut. Here is a screen shot: http://img391.imageshack.us/img391/8725/konsolemenubaruu9.png Thanks for Nihui reporting this bug in kde-china mailing list. http://mail.kde.org/pipermail/kde-china/2008-July/001835.html
Thank-you for bringing this up. I didn't know that accelerators were represented differently in non-Western languages. I'll have to try the more complex approach of fixing XMLGUI so that I can put <text> tags in the konsoleui.rc file which over-ride the standard text for the File/View/Edit/Help etc. entries defined in uistandards.rc in kdelibs. Unfortunately this will require these entries in konsoleui.rc to be translated for each locale - is this going to be a problem for KDE 4.1?
Maybe you can write a script to copy the text items from uistandards.rc to konsoleui.rc. Then send a notice mail to kde-i18n-doc mailing list. If just remove some accel keys, it should not be a problem. When KDE 4.1 release? I just backed from vacation.
> When KDE 4.1 release? I just backed from vacation. July 29th. We need to sort this out this week.
*** Bug 166138 has been marked as a duplicate of this bug. ***
Hi Liang, From your description of how accelerators are represented in CJK languages I could just modify the code to strip out anything in parenthesies - for KDE 4.1 at least.
Created attachment 25995 [details] Patch which uses a regular expression to remove " (&Letters)" from menu items as well as just '&'
Hi Liang,Yukko, Please test the patch in comment #6. If that works for you then I will commit it for KDE 4.1. The 'proper' fix requires changes to kdelibs which could conceivably have an impact on other applications and therefore needs to be done at the start of the development cycle.
hi I've tested the patch in comment #6 in KDE 4.1 rc1. but this bug still exists :( http://img503.imageshack.us/img503/3684/konsolemenubar2zq5.png nihui
> I've tested the patch in comment #6 in KDE 4.1 rc1. To clarify - the patch isn't in KDE 4.1 RC1, you have to apply it to the source. I tested it by changing the text of one of the existing entries to "Text (&T)".
The regex in #6 patch should not have the leading \s before the parenthesis, as there are no spaces in CJK; otherwise it works, checked here on Japanese-localized Konsole. Another solution would be to let translators handle extra accelerator removal, by providing a "filtering" message, e.g.: ... itemText.remove('&'); itemText = i18nc("Menu title in main menu", "%1", itemText); menuItem->setText(itemText); ... after which translators can script modifications to the text being filtered (amounts to single function call). This is the solution I provided e.g. for toolbar icon labels, to be sure not to clash with something else in some unrelated language, and to allow solutions per language if needed. I can't say which of these two is better. At any rate, for 4.2 perhaps we should add a KLocale::stripAccelerator function -- this is already third out-of-kdelibs case where such a need arose (implementation wise it could use either of the above methods).
Created attachment 26023 [details] Patch which uses a translateable regular expression to remove accelerators from menu items Second revision of patch. Remove leading \s from regular expression and make the pattern string translateable in case the default causes problems in another language.
> At any rate, for 4.2 perhaps we should add a KLocale::stripAccelerator > function -- this is already third out-of-kdelibs case where such a need > arose (implementation wise it could use either of the above methods) I think that would be useful. Do you want to take care of it?
#11 works fine too; and regex as message is probably the best implementation for KLocale-centralized custom removal. I will take care of it, sooner or later -- long road to 4.2 :)
:D the second patch fixed it!
#11 is ok for me. Wait for perfect solution in 4.2.
Until then we'll call it fixed.
The translatable regular expression has not been added to konsole.po by Scripty today. Was the fix committed? :)
SVN commit 832422 by knight: Fix accelerator removal for non-Western languages which use "(&Letter)" to represent accelerators in menu items rather than just '&' in front of one letter. MainWindow::removeMenuAccelerators() Use a regexp to match "(&Letters)" as well as '&' CCBUG: 165949 M +5 -1 MainWindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=832422
SVN commit 832423 by knight: Remove required space before parenthesies in accelerator stripping regular expression. Chusslove informs me that there are no spaces in CJK. CCBUG: 165949 M +1 -1 MainWindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=832423
SVN commit 832424 by knight: Make pattern string for accelerator stripping pattern translateable. CCBUG: 165949 M +6 -2 MainWindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=832424
SVN commit 834213 by ilic: Backport stripping of accelerators from main menu items; do not make pattern i18n for the moment, to avoid breaking message freeze (noone needs to have it customized right away anyway; perhaps add later). CCBUG: 165949 M +8 -1 MainWindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=834213