translation of keyboard key names

Hi,

Considering the bug report https://bugs.documentfoundation.org/show_bug.cgi?id=126999, I need to know where is defined the translated name of each key of the keyboard. Does LibreOffice have its own translation or the translation is taken from the OS ?

Exploring Pootle, I see translation of several key names in the terminology. Is it enough to modify the translation at this point so that it is repeated for each keyboard shortcut?

Best regards.
JBF

Hi Jean-Baptiste

Those key names come from the vcl
      source:
https://cgit.freedesktop.org/libreoffice/core/tree/vcl/unx/generic/app/keysymnames.cxx

You may want to modify the arrayaImplReplacements_FrenchBest regards
Gabor Kelemen
2019. 08. 17. 22:17 keltezéssel,
      Jean-Baptiste Faure írta:
Hi,Considering the bug reporthttps://bugs.documentfoundation.org/show_bug.cgi?id=126999, I need
      to know where is defined the translated name of each key of the
      keyboard. Does LibreOffice have its own translation or the
      translation is taken from the OS ?Exploring Pootle, I see translation of several key names in the
      terminology. Is it enough to modify the translation at this point
      so that it is repeated for each keyboard shortcut?Best regards.JBF

Hi Gabor,

Hi Jean-Baptiste

Those key names come from the vcl
       source:
https://cgit.freedesktop.org/libreoffice/core/tree/vcl/unx/generic/app/keysymnames.cxx

Do you mean this file is not generated from Pootle ?

Best regards.
JBF

Hi Jean-Baptiste

Of course: no Pootle for these. This in itself might worth a separate
bug report as well.

And to make things funnier: there is a similar file for Windows too:

https://cgit.freedesktop.org/libreoffice/core/tree/vcl/win/window/keynames.cxx

You probably want to keep in sync these for a platform independent user
experience.

Best regards
Gabor

2019. 08. 18. 20:17 keltezéssel, Jean-Baptiste Faure írta:

Hi Jean-Baptiste

Of course: no Pootle for these. This in itself might worth a separate
bug report as well.

line 140, I changed:
XK_Return, "Retour"
to
XK_Return, "Entr\303\251e"

and rebuilt the master, but there is no change in the shortcut for page break, I still see Ctrl+Retour in the French UI.

Did I miss something?

Best regards.
JBF

Hi,

Of course: no Pootle for these. This in itself might worth a separate
bug report as well.

It's not so straight forward.

And to make things funnier: there is a similar file for Windows too:
https://cgit.freedesktop.org/libreoffice/core/tree/vcl/win/window/keynames.cxx

Because Windows uses different key codes than X, and may use different
names for certain keys. Also, historically Unix keyboards differ from
Windows keyboards. Additionally there's OSX of course..

You probably want to keep in sync these for a platform independent user
experience.

Au contraire. If possible you want to display the names or symbols the
user sees on the keyboard, which of course depends on the hardware, not
the installed UI language. We just assume that if the user uses
a certain UI translation s/he's familiar enough with the language to see
some key names in that language.

Also note that only a few keys are translated, and the amount differs
between languages. If a key does not explicitly have a name assigned,
the system is asked for the key name. So usually only the key names are
listed that for some reason need to be overridden with a specific
assignment in a given UI translation.

  Eike

Hi Jean-Baptiste,

line 140, I changed:
XK_Return, "Retour"
to
XK_Return, "Entr\303\251e"

So you're talking of vcl/unx/generic/app/keysymnames.cxx.

Note the /generic/, that mapping nowadays is only used with the
SAL_USE_VCLPLUGIN=gen backend.

All modern frameworks like gtk3 and even gtk2 already come with their
own key name mapping. The LibreOffice internal key code is converted to
the current backend's framework key code and for that the key name is
obtained.

  Eike

Hi Eike,

Hi Jean-Baptiste,

line 140, I changed:
XK_Return, "Retour"
to
XK_Return, "Entr\303\251e"

So you're talking of vcl/unx/generic/app/keysymnames.cxx.

Note the /generic/, that mapping nowadays is only used with the
SAL_USE_VCLPLUGIN=gen backend.

Indeed, my change works as expected if I use the gen backend.

All modern frameworks like gtk3 and even gtk2 already come with their
own key name mapping. The LibreOffice internal key code is converted to
the current backend's framework key code and for that the key name is
obtained.

Ok, so I can close bug 126999 as NotOurBug.

Thank you very much for your explanations.

Best regards.
JBF