Basic tool to detect duplicate use of accelerator keys in menus

Hi

During the community meetings of the LibreOffice conference there was a
discussion of accelerator keys in menus and how duplicate use of the same
accelerator key causes accessibility issues. It can be hard when
translating to know if a string is duplicated in a menu or not so I noted
that there are some accessibility checkers that check the menus of programs
for such issues. And promised to send a note here stating what checkers
does.

After thinking a bit about it I instead decided to write a small tool in
basic that uses the accessibility interfaces to traverse the menus and
print a report in Writer. This makes it possible to run from Linux, Windows
and even on Mac. You'll find some more information on how to use the tool
in the document below (also containing the relevant macros).

For the time being you can download the macros from:
https://www.dropbox.com/s/8e703zr5bxny27n/AcceleratorKeyChecker.odt?dl=1

There are some issues such as the tool can't reach submenus that has been
deactivated. But for now this will probably do for most of you.

Regards,
/Niklas

Hi Niklas,

This has often been debated but I don't think anything ever happened. The main issue with any such tool is that unless it links to the unique UI string, it's not much help because most of the time there are like 50 incidences of &Edit and to make matters worse, we have _Edit and &Edit type hotkeys and worse still, if I search for Edit and the string is E&dit, it won't get found.

The summary of previous discussions is that if a locale does not assign hotkeys, the system does it automatically - which no one tells you when you start out, and while I'd prefer that for our locale, I don't have the resources to strip all existing hotkeys. Other than that, there are the usual problems of not knowing the scope (i.e. what other UI strings are sharing the menu with said string) and restricted letter sets (Gaelic has 18 letters, fewer if you ignore letters with descenders...)

Ideally I think we'd need a tool which during localization flags "Duplicated hotkey in menu scope" + list of strings in scope. And/or a tool that allows locales which do not want to assign hotkeys manually to strip them all from the existing files so the system can automatically deal with the issue.

Michael

Sgrìobh Niklas Johansson na leanas 24/09/2015 aig 10:01:

Hi Michael

Well this is not as big a problem as you make it. Basically you open the
document I sent a link to earlier. The UI language of LibreOffice should be
set to the language that you want to check. Generate the report, which will
list all menus and sub-menus and highlight the problematic menu entries.
Save the file and change the UI language to KeyID and reopen the report
there. Now you can easily find the exact string in Pootle.

Let me know if you do not know what KeyID is and how to use it.

/Niklas

Well done, Niklas!
Although It looks like for Cyrillic locales accelerators are not being put
to result correctly, all I see is little rectangles instead of actual
accellerator letters.
Latin letters are being processed correctly.

Thanks,

I was not aware that it had been implemented, that's good news :slight_smile:

If you could point me at a page that explains how to KeyID, that would be great.

Michael

Sgrìobh Niklas Johansson na leanas 24/09/2015 aig 12:39:

Hello again

A short description of how to use KeyID can be found at:
https://wiki.documentfoundation.org/Language#KeyID

The dialy builds of LibreOffice should contain the KeyID version (has the
language code qtz)
http://dev-builds.libreoffice.org/daily/

/Niklas

Thank you!

Michael

Sgrìobh Niklas Johansson na leanas 24/09/2015 aig 13:42:

This is great! Plenty of work to do...

I'm having difficulty getting the KeyID to work, I've identified that the necessary files may be:

and possibly
master~2015-09-23_05.16.23_LibreOfficeDev_5.1.0.0.alpha1_Win_x86_helppack_qtz.msi <http://dev-builds.libreoffice.org/daily/master/Win-x86@62-merge-TDF/2015-09-23_05.16.23/master~2015-09-23_05.16.23_LibreOfficeDev_5.1.0.0.alpha1_Win_x86_helppack_qtz.msi> and have installed both and followed the instructions: Tools>Options>Language Settings>Languages>User Interface.

But I'm only seeing English USA. I'm not seeing KeyID, nor de, ar, ja or ru. I'm doing something wrong here.
Any suggestions?
Rhos

Ar 24/09/2015 13:42, ysgrifennodd Niklas Johansson:

Hi Niklas

Will this tool work on fresh builds without keyid?

Regards

Click Tools - Options - Language Settings - Languages,
then select KeyID in User interface dropbox and restart LO.

Thanks, Serg.

What I've done - twice on two separate computers, is to install both :

and
master~2015-09-23_05.16.23_LibreOfficeDev_5.1.0.0.alpha1_Win_x86_helppack_qtz.msi <http://dev-builds.libreoffice.org/daily/master/Win-x86@62-merge-TDF/2015-09-23_05.16.23/master~2015-09-23_05.16.23_LibreOfficeDev_5.1.0.0.alpha1_Win_x86_helppack_qtz.msi>

Then I've gone to: Tools>Options>Language Settings>Languages>User Interface.

But all I'm seeing in the dropdown menue is English USA. No KeyID, de, ar, ja or ru or anything else.

The detail on https://wiki.documentfoundation.org/Language does not relate to what's on the server,
I could'nt find files with langpack_qtz in their name, am I using the wrong files? If so where are the right files?

      KeyID

For major versions, KeyID builds are available in alpha and beta releases. This special build allows to display the KeyID reference of each string in the menus and dialogs. It is a available as a language pack, where the language reference is replaced by *qtz* in the version name (for example LibreOfficeDev_4.3.0.0.alpha1_Linux_x86-64_deb_langpack_qtz.tar.gz and LibreOfficeDev_4.2.0.0.beta2_Linux_x86_deb_langpack_qtz.tar.gz).

To install this lang pack:

  * download the package
  * depending on your system, install it as usual after installing the
    main package
  * go under Tools ▸ Options ▸ Language Settings ▸ Languages and change
    the *User Interface* to *KeyID*
  * when you reopen LibreOffice, you can see now the string reference in
    front of each menu and dialog

Thanks
Rhos

Ar 25/09/2015 08:23, ysgrifennodd Serg Bormant:

I'm searching for this, but can't find.
Using Linux Mint, would like to get that language pack to get key IDs.

Your script is working perfectly!

24.09.2015 u 14:42, Niklas Johansson je napisao/la:

Hmm... I should have checked that before posting. I usually just run my own build version on Linux,
I just assumed that they would have qtz-builds at least for master, but it seems they don't. :frowning:

You can however find qtz-builds of 5.0.0.0.beta3:
https://downloadarchive.documentfoundation.org/libreoffice/old/5.0.0.0.beta3/deb/

The KeyIDs should correspond to what is in LibreOffice 5.

I'll ask on IRC tomorrow if there are any KeyID-builds available for Linux as daily builds,
or if not if there could be in the future.

Don't forget do do a parallel install:
https://wiki.documentfoundation.org/Installing_in_parallel/Linux

Regards,
Niklas Johansson

I created a accelerator key report for KeyID from a master build (a few days old though).
That way you can easily compare the reports to find the menu entries in Pootle.

https://www.dropbox.com/s/a9pwjonlhnefja8/KeyID%20-%20Accelerator%20key%20check%20report.odt?dl=1

Regards,
Niklas Johansson

Last Friday my first patch towards this issue got pushed, so now the tool should
work on the master branch, even for non ascii characters.

I did a test with the tool on the language Kazakh, you'll find the report below.
https://www.dropbox.com/s/d1yguco1u2w0s6c/Kazakh%20-%20Accelerator%20key%20check%20report.odt?dl=1

Regards,
Niklas Johansson

Hi,
Do you have updated macros, or is it still the same? When do you think
your patch will enter regular release, wIll it make to 5.0.x?

Thanks,

Hi

No the macro document from before should work, the change is in LibreOffice.
I haven't back ported the patch to 5.0 yet waiting a bit to see if my follow-up
patch gets pushed first. Plus I'm a bit short on time at the moment. :wink:
But I will likely ask for a back port in the following week or so.

Regards,
Niklas Johansson

Has anyone got this to work? It could be handy.
I checked the latest build:
libreoffice-5-0~2015-11-11_12.42.14_LibreOfficeDev_5.0.4.0.0_Win_x86_en-US_de_ar_ja_ru_qtz.msi

and then Tools>Options>User Interface but no qtz.
Any suggestions?
Rhos

Ar 07/10/2015 08:57, ysgrifennodd Niklas Johansson: