Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Cedric Bosdonnat
On Mon, 2012-01-23 at 06:29 +0100, Jean-Baptiste Faure wrote:
 Hi all,
 
 In LO 3.4.5  and LO 3.5.0 rc1+ we have a weird shortcut key in Writer in
 the menu Edit  Repeat. It is the word Encore. We have that for the UI
 in French and even for the UI in English.
 This shortcut key Encore is in Tools  Customize too.
 
 Do you know what does mean ? Bug or feature ?

That one is a bug. The keycode com::sun::star::awt::Key::REPEAT is
assigned to that menu entry... and it ends up being translated with the
Sun keyboard key (see that file [0]).

That brings several questions to me: how comes the translation of the
key names is depending on the keyboard model? I have a normal french
keyboard with en-US locale and en-US libreoffice build.

[0]: 
http://opengrok.libreoffice.org/xref/core/vcl/unx/generic/app/keysymnames.cxx

--
Cedric

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Michael Meeks

On Mon, 2012-01-23 at 10:25 +0100, Cedric Bosdonnat wrote:
 That one is a bug. The keycode com::sun::star::awt::Key::REPEAT is
 assigned to that menu entry... and it ends up being translated with the
 Sun keyboard key (see that file [0]).

Ho hum; nasty :-)

 That brings several questions to me: how comes the translation of the
 key names is depending on the keyboard model? I have a normal french
 keyboard with en-US locale and en-US libreoffice build.

Well - I guess the -idea- is prolly to try to show the user the key
that is written on their keyboard, rather than a generic 'Ctrl' for
Control - it can show 'Control' (if that is what is written there) or
somesuch.

IMHO that leads to excessive ugliness and a ton of code in there that
(AFAICS) works well only for obscure unix'es.

But, of course, some keyboards really do have oddly named keys that we
want to assign shortcuts to so ...

I was pondering what to do with the code the other day; if it is not
even working for the common cases  ;-)

ATB,

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Pedro Lino
Hi Michael, all

Well - I guess the -idea- is prolly to try to show the user the key
 that is written on their keyboard, rather than a generic 'Ctrl' for
 Control - it can show 'Control' (if that is what is written there) or
 somesuch.


I think it would make sense for different countries since special keys have
different text...

That said this would mean having a database of ALL keyboard models for ALL
brands for ALL supported Languages, which was fine when there was IBM and
HP... Today... well just look at the keyboard section in any supply store :)

E.g. I have two Logitech keyboards with Portuguese layout. Model Y-SR34 has
an Insert key; in Model K120 the key has been translated (correctly :) )
to the Portuguese word Inserir.
If you want to cover all keyboards that is the kind of information that
would have to be available :)


   I was pondering what to do with the code the other day; if it is not
 even working for the common cases  ;-)


IMO remove it all. It doesn't make any sense to cater for some old unused
models (and introducing unneeded errors) while not supporting the huge
amount of newer keyboards.

Just my 2 (non-dev) cents :)

Regards,
Pedro
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Stefan Knorr (Astron)
Hi all,


 That brings several questions to me: how comes the translation of the
 key names is depending on the keyboard model? I have a normal french
 keyboard with en-US locale and en-US libreoffice build.

        Well - I guess the -idea- is prolly to try to show the user the key
 that is written on their keyboard, rather than a generic 'Ctrl' for
 Control - it can show 'Control' (if that is what is written there) or
 somesuch.

I would like to say that I hate the fact that regardless of the rest
of my UI, LibreOffice keyboard shortcuts are always displayed in
German [1]. I believe this behaviour is also inconsistent wrt to
almost any other software.


        But, of course, some keyboards really do have oddly named keys that we
 want to assign shortcuts to so ...

All we should need is localised versions of key names like Ctrl, Del,
Ins (that are on almost every keyboard [1], but whose names can
change) and global versions of key names for
alphanumeric/script-specific keys (which might not be on every
keyboard, but whose names are the same internationally).
So, looking at the code, we'd need to just move the keyboard language
specific data to the specific locales. This also seems a lot more
scalable than for every localiser having to ask a developer to add
their native keys into this code.



Astron.


[1] I use a German keyboard and an English locale of my OS.
[2] I think their names only differ between PC and Mac keyboards.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Pedro Lino
Hi Stefan, all


 All we should need is localised versions of key names like Ctrl, Del,
 Ins (that are on almost every keyboard [1], but whose names can
 change) and global versions of key names for
 alphanumeric/script-specific keys (which might not be on every
 keyboard, but whose names are the same internationally).
 So, looking at the code, we'd need to just move the keyboard language
 specific data to the specific locales. This also seems a lot more
 scalable than for every localiser having to ask a developer to add
 their native keys into this code.


That would be too simple. See my example in the previous email.
You would need to match the keys for EACH keyboard model, regardless of
Locale.

This is particularly true for laptops (at least in Portugal...). All
laptops sold in Portugal have a Portuguese layout but the Special keys
(like Ctrl, Alt, Insert) have the English text. Obviously manufacturers do
this to save on producing specific keys. So Locale doesn't solve the
problem.

Regards,
Pedro
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Stefan Knorr (Astron)
Hi Pedro,

 That would be too simple. See my example in the previous email.
 You would need to match the keys for EACH keyboard model, regardless of
 Locale.

Well, that doesn't scale (at least I can't believe it does), as it
would probably make adding keyboard layout stuff a full-time job and
add quite a few MB of install size.
(But I am biased because I am currently annoyed at the fact that only
because I use a German keyboard (with Strg, Einf, Druck printed on the
Ctrl, Ins, Prnt keys), I also get these German key names in my English
LibO interface. That looks ugly, especially on screenshots.)


 This is particularly true for laptops (at least in Portugal...). All laptops
 sold in Portugal have a Portuguese layout but the Special keys (like Ctrl,
 Alt, Insert) have the English text. Obviously manufacturers do this to save
 on producing specific keys. So Locale doesn't solve the problem.

That's really arrogant on the part of manufacturers (since Portuguese
is quite an important language, I believe), but if that really is the
case for most Portuguese computers, then it might make sense to
translate string [en-US]=Ctrl as string [pt-PT]=Ctrl, etc. But
that decision should be left to the localisers.
If keys are actually uncommon in a certain locale, like SysRq is
becoming (in all locales, though), then we can only avoid using that
for default shortcuts.


Regards,

Astron.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [Libreoffice-qa] weird shortcut key for repeat action in Writer

2012-01-23 Thread Pedro Lino
Hi Rimas, all

I think you'd just have to choose which label to use. Correctly matching
 key names with the keyboard model is hardly impossible. I would say you'd
 just have to choose whether to use Inserir or Insert, and stick to that
 choice. Which strings you would choose would be completely up to you, but
 you could of course take popularity and other factors into account.


That is exactly the problem! You can not choose. It is selected based on
Locale. And that is exactly what Stefan (Astron) is complaining about.
Instead of creating a huge database, there could be simply an option in the
Language settings. The keyboard would be selected based on Locale but the
user would have the option to switch to the Language that matches the
keyboard buttons (or that matches the GUI, as Stefan mentioned)

Regards,
Pedro
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice