Lisp HUG Maillist Archive

Internationalization and shortcuts

Hi,

I¹m looking for info about shortcuts and accelerators compatibility between
languages and types of keyboards.

I work on a AZERTY keyboard because I speak French. On this type of kb the
normal undo accelerator is Command-Z (or Control-Z on Windows) because Z is
the position of the U on a QUERTY keyboard...

Now, if I write an accelerator for an Undo item, Command-U will be wrong for
a French User, and naturally Command-Z will be wrong for an English or
American User.

What's the solution to this kind of situation ?

For Shortcuts, the problem is a little bit different : I would like to use
the Option+character or Shift-Option+character. But the characters generated
by these shortcuts are naturally not the same on a French or an English
system. If I write a shortcut on the character "è" for instance, I'm afraid
you can never use it on an English system...

Is it a solution to write a shortcut witch is really the combination of :
a modifiers combination + a simple character
independently of witch character is locally generated by this shortcut on a
system or another one ?

Thanks for any links or comments

Denis


-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Re: Internationalization and shortcuts

Hello Denis,

| I¹m looking for info about shortcuts and accelerators compatibility
| between languages and types of keyboards.
|
| I work on a AZERTY keyboard because I speak French. On this type of kb
| the normal undo accelerator is Command-Z (or Control-Z on Windows)
| because Z is the position of the U on a QUERTY keyboard...
|
| Now, if I write an accelerator for an Undo item, Command-U will be
| wrong for a French User, and naturally Command-Z will be wrong for an
| English or American User.
|
| What's the solution to this kind of situation ?

Russian localized software always binds the undo command with Control-Z as
if on QUERTY. In my experience, the accelerator invoke this command even
when the Windows locale and keyboard layout is Russian. The common practice
of choosing accelerators is transliterating some letter (usually the first)
to English.

(Sometimes accelerators defined in a CAPI interface stop working, and the
user has to switch to another window and back to reanimate them but this is
a distinct question :-))

But take into account that Russian is based on Cyrillic, and after switching
the keyboard layout, you get absolutely different letters for all the
alphabetic buttons of the keyboard, not just the same Latin letters (with
few variants) laid out differently.

| For Shortcuts, the problem is a little bit different : I would like to
| use the Option+character or Shift-Option+character. But the characters
| generated by these shortcuts are naturally not the same on a French or
| an English system. If I write a shortcut on the character "è" for
| instance, I'm afraid you can never use it on an English system...
|
| Is it a solution to write a shortcut witch is really the combination of
| : a modifiers combination + a simple character
| independently of witch character is locally generated by this shortcut
| on a system or another one ?

I am afraid not. For many keys, I do customize binding like
     (bind-key "Grid Undo" #\Control-\Ya)
     (bind-key "Grid Undo" #\Control-\Capital-Ye).
So I would suggest delivering localized versions of your application.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: Internationalization and shortcuts

Le 9/11/07 7:36, Dmitriy Ivanov a écrit :

> Russian localized software always binds the undo command with Control-Z as
> if on QUERTY. In my experience, the accelerator invoke this command even
> when the Windows locale and keyboard layout is Russian. The common practice
> of choosing accelerators is transliterating some letter (usually the first)
> to English. 

I write all my menus in English, and I use this technique.
But why Z for undo ??? I was very proud to found that it's the equivalent
key on QUERTY keyboards... but, if it's not the explanation, what's the
logic ? (but well it's not so important if I'm sure my accelerators are
correct for a QUERTY user)

> I am afraid not. For many keys, I do customize binding like
>      (bind-key "Grid Undo" #\Control-\Ya)
>      (bind-key "Grid Undo" #\Control-\Capital-Ye).
> So I would suggest delivering localized versions of your application.

Oulala... I absolutely would like to avoid this solution.

But, it depends what you mean by "localized version". On Mac I use the
"Localized String" mechanism for dialogs (just strings are localized => no
duplication of the codes), does it exists something similar for shortcuts?

Thanks for your answer Dmitriy

Denis




> Hello Denis,
> 
> | I¹m looking for info about shortcuts and accelerators compatibility
> | between languages and types of keyboards.
> |
> | I work on a AZERTY keyboard because I speak French. On this type of kb
> | the normal undo accelerator is Command-Z (or Control-Z on Windows)
> | because Z is the position of the U on a QUERTY keyboard...
> |
> | Now, if I write an accelerator for an Undo item, Command-U will be
> | wrong for a French User, and naturally Command-Z will be wrong for an
> | English or American User.
> |
> | What's the solution to this kind of situation ?
> 
> Russian localized software always binds the undo command with Control-Z as
> if on QUERTY. In my experience, the accelerator invoke this command even
> when the Windows locale and keyboard layout is Russian. The common practice
> of choosing accelerators is transliterating some letter (usually the first)
> to English.
> 
> (Sometimes accelerators defined in a CAPI interface stop working, and the
> user has to switch to another window and back to reanimate them but this is
> a distinct question :-))
> 
> But take into account that Russian is based on Cyrillic, and after switching
> the keyboard layout, you get absolutely different letters for all the
> alphabetic buttons of the keyboard, not just the same Latin letters (with
> few variants) laid out differently.
> 
> | For Shortcuts, the problem is a little bit different : I would like to
> | use the Option+character or Shift-Option+character. But the characters
> | generated by these shortcuts are naturally not the same on a French or
> | an English system. If I write a shortcut on the character "è" for
> | instance, I'm afraid you can never use it on an English system...
> |
> | Is it a solution to write a shortcut witch is really the combination of
> | : a modifiers combination + a simple character
> | independently of witch character is locally generated by this shortcut
> | on a system or another one ?
> 
> I am afraid not. For many keys, I do customize binding like
>      (bind-key "Grid Undo" #\Control-\Ya)
>      (bind-key "Grid Undo" #\Control-\Capital-Ye).
> So I would suggest delivering localized versions of your application.
> --
> Sincerely,
> Dmitriy Ivanov
> lisp.ystok.ru
> 

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Re: Internationalization and shortcuts

Denis Pousseur wrote on Fri, 09 Nov 2007 10:24:19 +0100 12:24:

| I write all my menus in English, and I use this technique.
| But why Z for undo ??? I was very proud to found that it's the
| equivalent key on QUERTY keyboards... but, if it's not the explanation,
| what's the logic ? (but well it's not so important if I'm sure my
| accelerators are correct for a QUERTY user)

I think this is a kind of tradition (which I am personally not fond of as I
prefer Alt-Backspace).

|> I am afraid not. For many keys, I do customize binding like
|>      (bind-key "Grid Undo" #\Control-\Ya)
|>      (bind-key "Grid Undo" #\Control-\Capital-Ye).
|> So I would suggest delivering localized versions of your application.
|
| Oulala... I absolutely would like to avoid this solution.
|
| But, it depends what you mean by "localized version". On Mac I use the
| "Localized String" mechanism for dialogs (just strings are localized =>
| no duplication of the codes), does it exists something similar for
| shortcuts?

So do I. You could need more than just string, but also, for example,
mnemonic positions. I have not managed to avoid featuring my code with
#-Russian and #+Russian and placing fasl-files into different subdirectories
of bin/.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: Internationalization and shortcuts

> So do I. You could need more than just string, but also, for example,
> mnemonic positions.

If I well understand, I have to do this in my key-event-callback :

-replace my shortcuts by calls to Localized Strings
-in the external .string files, write the equivalent characters for (for
instance) SHIFT-OPTION-E in French, in English, etc. (and first find it...)
-finally deal with these strings in the test

Is that correct ?

Thanks for your help

Denis


Le 9/11/07 11:55, « [NOM] » <[ADRESSE]> a écrit :

> Denis Pousseur wrote on Fri, 09 Nov 2007 10:24:19 +0100 12:24:
> 
> | I write all my menus in English, and I use this technique.
> | But why Z for undo ??? I was very proud to found that it's the
> | equivalent key on QUERTY keyboards... but, if it's not the explanation,
> | what's the logic ? (but well it's not so important if I'm sure my
> | accelerators are correct for a QUERTY user)
> 
> I think this is a kind of tradition (which I am personally not fond of as I
> prefer Alt-Backspace).
> 
> |> I am afraid not. For many keys, I do customize binding like
> |>      (bind-key "Grid Undo" #\Control-\Ya)
> |>      (bind-key "Grid Undo" #\Control-\Capital-Ye).
> |> So I would suggest delivering localized versions of your application.
> |
> | Oulala... I absolutely would like to avoid this solution.
> |
> | But, it depends what you mean by "localized version". On Mac I use the
> | "Localized String" mechanism for dialogs (just strings are localized =>
> | no duplication of the codes), does it exists something similar for
> | shortcuts?
> 
> So do I. You could need more than just string, but also, for example,
> mnemonic positions. I have not managed to avoid featuring my code with
> #-Russian and #+Russian and placing fasl-files into different subdirectories
> of bin/.
> --
> Sincerely,
> Dmitriy Ivanov
> lisp.ystok.ru
> 

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Re: Internationalization and shortcuts

Denis Pousseur wrote on Fri, 09 Nov 2007 12:43:48 +0100 14:43:

| If I well understand, I have to do this in my key-event-callback :
|
| -replace my shortcuts by calls to Localized Strings
| -in the external .string files, write the equivalent characters for
| (for instance) SHIFT-OPTION-E in French, in English, etc. (and first
| find it...) -finally deal with these strings in the test
|
| Is that correct ?

I do not know what your Localized Strings facility is exactly, so I can only
guess that this should work.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: Internationalization and shortcuts

Re: Internationalization and shortcuts For Mac users only :

I found this NS method witch is exactly what I'm looking for :

(objc::invoke-into 'objc::string event "charactersIgnoringModifiers")

Invoked on the current key event, the method return the character as if it was typed *without* any modifier key (except for Shift). [See below for more details]

Best Denis
-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------


charactersIgnoringModifiers
Returns the characters generated by the receiving key event as if no modifier key (except for Shift) applies.

- (NSString *)charactersIgnoringModifiers

Discussio
n
Raises a
n NSInternalInconsistencyException if sent to a nonkey event.

This method returns the non-modifier key character pressed for dead keys, such as Option-e. For example, Option-e (no shift key) returns an “e" for this method, whereas t
he characters method returns an empty string.

This method is useful for determining “basic” key values in a hardware-independent manner, enabling such features as keyboard equivalents defined in terms of modifier keys plus character keys. For example, to determine if the user typed Alt-S, you don’t have to know whether Alt-S generates a German double ess, an integral sign, or a section symbol. You simply examine the string returned by this method along with the event’s modifier flags, checking for “s”
and NSAlternateKeyMask.

Availabi
lity
Available in Mac OS X v10.0 and later.


Re: Internationalization and shortcuts


On Nov 9, 2007, at 10:24, Denis Pousseur wrote:

>
> Le 9/11/07 7:36, Dmitriy Ivanov a écrit :
>
>> Russian localized software always binds the undo command with  
>> Control-Z as
>> if on QUERTY. In my experience, the accelerator invoke this  
>> command even
>> when the Windows locale and keyboard layout is Russian. The common  
>> practice
>> of choosing accelerators is transliterating some letter (usually  
>> the first)
>> to English.
>
> I write all my menus in English, and I use this technique.
> But why Z for undo ??? I was very proud to found that it's the  
> equivalent
> key on QUERTY keyboards... but, if it's not the explanation, what's  
> the
> logic ? (but well it's not so important if I'm sure my accelerators  
> are
> correct for a QUERTY user)

The logic is simple: the copy/paste/cut and command command are close  
together in functionality, and their keys are close together for  
convenience (on a QWERTY): ZXCV. Don't try to find any mnemonic,  
except for Copy (C), and maybe Cut (X = cross out, delete). The V and  
Z keys are nearby, and easy to reach in combination with the Control  
key.

Cheers,
Peter.

Updated at: 2020-12-10 08:45 UTC