Page 1 of 3
Menuclass localization hook: also empty result
Posted: Thu Sep 10, 2015 2:03 pm
by blmara
Hi,
along with the new SDK we got the possibility to use the new menu class to implement application menus. This seems to be very powerful and flexible tool compared to the traditional menu routines. Especially handy is the feature of dynamic menu localization using the MenuStringMessage and the associated hook. But, both according to the SDK Wiki
http://wiki.amigaos.net/wiki/Intuition_Menu_Class article and my testing, it seems to be impossible to give NULL translation to menu item keyboard shortcut. This is always shown as "????" in the place of shortcut in the menu. For the future menuclass version it would be nice to be able to choose not to have the menu shortcut in the catalog translation level. Of course, the programmer can leave the MA_Key attribute away and make the decision for all languages.
Marko
Re: Menuclass localization hook: also empty result
Posted: Thu Sep 10, 2015 10:18 pm
by nbache
blmara wrote:it seems to be impossible to give NULL translation to menu item keyboard shortcut. This is always shown as "????" in the place of shortcut in the menu. For the future menuclass version it would be nice to be able to choose not to have the menu shortcut in the catalog translation level. Of course, the programmer can leave the MA_Key attribute away and make the decision for all languages.
In general, menu shortcut keys should never be changed when translating. So there is no good reason to set a menu shortcut key, which was present in the original, to null in a translation.
The reason you should not change the menu shortcut keys is one of safety. If a user has learnt the shortcuts (s)he uses most, and maybe one day uses a machine with a different locale, it would be potentially dangerous to have a well-known shortcut take on a different meaning. Imagine you wanted to print, but R-Amiga P suddenly means Delete. And remember, you can't see the menu shortcuts when you use them. Only when you don't (i.e. you open the actual menu).
I don't know if that is the reason for not making it possible in the menu class, but it makes sense to me.
Best regards,
Niels
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 10:06 am
by OldFart
@nbache
Is there a list available with 'preferred shortcuts'? Like these ones used in virtually all textrelated software: RAmiga+C = Copy, RAmiga+X = Cut and RAmiga+V = Insert (or is it: Amiga+C = Copy, Amiga+X = Cut and Amiga+V = Insert)? Some programs use a plethora of shortcuts and mostly nobody knows/remembers or even cares about. The risk with such wildgrowth in shortcuts is the one you described: the hazardous potential inflicted by the difference of meaning although not within the same program but between programs.
I would not mind having some form of 'automated' shortcut generation, say by prefixing the character with an underscore.
On a side note: there seems to be a number of shortcuts for Workbench, but however hard I tried to document them, I never got far as every now and again someone comes up with another one previously unheard of.
OldFart
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 10:16 am
by trixie
@nbache
nbache wrote:In general, menu shortcut keys should never be changed when translating.
The confusion about this may originate - surprise, surprise! - from the Amiga User Interface Style Guide, which (in the Application Keyboard Shortcuts / Menus section) reads the following:
Use a Right-Amiga combination as the default keyboard shortcut for a menu item. Here is a list of the defaults in the English language for an application that has standard menus. This should be localized to the language at hand for non-English applications.
Perhaps the sentence I've marked in bold above should be removed in the respective wiki page? And an explicit note about
not localizing keyboard shortcuts should be added?
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 10:22 am
by trixie
@OldFart
Is there a list available with 'preferred shortcuts'?
See here:
http://wiki.amigaos.net/wiki/UI_Style_G ... oard#Menus
But the list is rather basic, it doesn't specify the preferred shortcut for "About" (most programs use RAmiga + ?) or "Iconify". Plus, the RAmiga + A combination for "Save As" is IMHO very debatable because the shortcut should normally be used for a "Select All / Mark All"-type operation, as is the convention on other systems.
Edit: added RAmiga + ? to the list in the wiki.
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 5:21 pm
by blmara
nbache wrote:...
The reason you should not change the menu shortcut keys is one of safety. If a user has learnt the shortcuts (s)he uses most, and maybe one day uses a machine with a different locale, it would be potentially dangerous to have a well-known shortcut take on a different meaning. Imagine you wanted to print, but R-Amiga P suddenly means Delete. And remember, you can't see the menu shortcuts when you use them. Only when you don't (i.e. you open the actual menu).
I don't know if that is the reason for not making it possible in the menu class, but it makes sense to me.
Best regards,
Niels
Reasonable explanation. I can live with it.
Marko
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 10:35 pm
by nbache
trixie wrote:The confusion about this may originate - surprise, surprise! - from the Amiga User Interface Style Guide, which (in the Application Keyboard Shortcuts / Menus section) reads the following:
Use a Right-Amiga combination as the default keyboard shortcut for a menu item. Here is a list of the defaults in the English language for an application that has standard menus. This should be localized to the language at hand for non-English applications.
Yes, this is actually a very unfortunate suggestion. I guess they simply hadn't thought through the potential consequences back when it was written. The debate which originally alerted me to the problem took place within ATO (back in the late nineties I think), and we ended up making it a standard, at least in the Danish department, but I think also in others.
Perhaps the sentence I've marked in bold above should be removed in the respective wiki page? And an explicit note about not localizing keyboard shortcuts should be added?
Sounds like a very good idea.
Best regards,
Niels
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 10:44 pm
by nbache
trixie wrote:But the list is rather basic, it doesn't specify the preferred shortcut for "About" (most programs use RAmiga + ?) or "Iconify".
True. Iconification wasn't really a common feature back then, though, I think it was MUI which made it so later on. The About box has been a standard from the start, I believe, but maybe not giving it a shortcut. The question mark is definitely a de facto standard by now which ought to be canonized.
Plus, the RAmiga + A combination for "Save As" is IMHO very debatable because the shortcut should normally be used for a "Select All / Mark All"-type operation, as is the convention on other systems.
True, but unfortunately it is already in very common use in Amiga programs - old as well as newer - as "Save as". It probably wouldn't be a good idea to change it now.
Best regards,
Niels
Re: Menuclass localization hook: also empty result
Posted: Fri Sep 11, 2015 10:47 pm
by nbache
OldFart wrote:On a side note: there seems to be a number of shortcuts for Workbench, but however hard I tried to document them, I never got far as every now and again someone comes up with another one previously unheard of.
I believe we got most of them covered in Workbench.guide - available by clicking your big friendly WBHelp lightbulb in AmiDock

. Check out section III.
Best regards,
Niels
Re: Menuclass localization hook: also empty result
Posted: Sun Sep 13, 2015 10:15 am
by trixie
@nbache
Updated the Keyboard chapter of the Style Guide:
http://wiki.amigaos.net/wiki/UI_Style_Guide_Keyboard
True, but unfortunately it is already in very common use in Amiga programs - old as well as newer - as "Save as". It probably wouldn't be a good idea to change it now.
Fortunately, not all Amiga programs need to implement "Select/mark all". But if I were to write, for example, a text editor I'd use "RAmiga-A" for "Select all text" (to stay in line with the convention in other OSes) and leave the "Save as" menu item with no shortcut.