Fixes and changes to Lokalize, request for feedback

Karl Ove Hufthammer karl at huftis.org
Sun Jul 28 23:11:12 BST 2024


Eloy Cuadra skreiv 28.07.2024 23:08:
>> Some keyboard layouts have the character easily accessible. For example,
>> the ‘nodeadkeys’ variant of the Spanish layout has it on ‘AltGr + -’
>> (‘AltGr’ is the *right* ‘Alt’ key). To test it, you can load the
>> keyboard layout like this (or use the keyboard layout options in system
>> settings):
>>
>> setxkbmap -layout es -variant nodeadkeys
> Although the Spanish keyboard layout without dead keys inserts the ellipsis
> character when pressing the key combination 'AltGr + -', this is not the ideal
> solution, since the dead keys would stop working with this layout (i.e., we
> would have the same problem when entering accented vowels, which are widely
> used in Spanish). In other words, this keyboard layout solves one problem to
> create another that did not previously exist.

Yes, I agree that this isn’t an ideal solution. It would probably be 
best to submit an update to the official X keyboard configuration 
database (either for the Spanish keyboard layout in particular or for 
the ‘latin’ keyboard layouts in general, which are shared between many 
countries):

https://www.freedesktop.org/wiki/Software/XKeyboardConfig/

Of course then it will take some time before the new keybindings are 
available in distros. But once it’s done, they will be available for 
everyone, forever.

We did this for the Norwegian keyboard layout in 2009:
https://bugs.freedesktop.org/show_bug.cgi?id=23518


>> I agree that this can be made simpler. On the other hand, I’m not sure
>> adding support for this in Lokalize is the best way forward. Easy access
>> to special characters is really the domain of the input method (e.g.,
>> ibus or fcitx5). And when using the correct input method, inserting
>> these characters will be easy in *all* applications, not just in Lokalize.
> Many text editing programs have options of this type to change certain
> character combinations to their Unicode equivalents. Lokalize is, after all, a
> specialized text editor.

One option would be to implement a general autocorrect feature. But this 
should preferably be implemented in the general KTextEditor component, 
which is shared between several text editors (Kate, KWrite, Lokalize, 
Kile, …).

BTW, I accidentally discovered that implementing an ‘insert character’ 
feature in Lokalize was actually rejected already in the original design 
document for Lokalize (then called KAider). (There *was* such a feature 
in the earlier KBabel localisation application.) See:
https://techbase.kde.org/Projects/Summer_of_Code/2007/Projects/KAider#KBabel_features_NOT_to_be_implemented


> The ellipsis case is just one example. The KDE HIG covers several other cases,
> such as →, ÷, ×, —, etc. (some of them not used in Spanish or in other
> languages).

Most of these are actually available in the default Spanish keyboard layout:

→: AltGr + i
÷: AltGr + Shift + .
×: AltGr + Shift + ,

You can also enable the ‘Compose’ key (if it’s not enabled by default). 
It can be set to a key like ‘AltGr’ or ‘Scroll Lock’, and it works with 
*any* keyboard layout. Then you can press:

‘Compose [release the key] ..’ to insert a … (ellipsis character)
‘Compose [release the key] <-’ to insert a ←
‘Compose [release the key] +-’ to insert a ±
‘Compose [release the key] 23’ to insert a ⅔
‘Compose [release the key] /o’ to insert a ø
etc.
(You don’t *have* to release the key, but it’s usually easier to do it.)

You can enable the ‘Compose’ key in the KDE System Settings:
Keyboard → Keybindings → Position of Compose key


-- 
Karl Ove Hufthammer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-i18n-doc/attachments/20240729/42ffbcf0/attachment.htm>


More information about the kde-i18n-doc mailing list