[yast-devel] Some questions about keyboard layouts
Hi all, I am Joaquín and I am working on a rewrite of YaST keyboard module, info here [1]. In a nutshell, I am writing a keyboard module for YaST with ruby using OOD, with an implementation for SystemD. Right now i am looking to map the code of every keyboard layout (for example: us, es, us-dvorak) with their human readable translation ( “English (US)”, “Spanish”,...), but i have some questions about it. I have taken a look to the existing code to try to use the same translations. And i found two files, “keyboard_raw_opensuse.ycp” and “keyboard_raw.ycp”. Also i found the part of the code that is using one of these two files [2]. The only difference between these files i see, is that in some cases, for a language one file uses a .map.gz file and the other use a different .map.gz, for example with “spanish-lat” see [3] and [4]. I think that with only one map for each code is enough for an implementation with SystemD but i am not sure, because I don’t understand the reason of these differences in the current module. It would be nice if some of you can explain to me so i can understand it, and apply a good solution in the project. Also in the case that is only needed one mapping, which of those files should i take as reference? Thank you all, Joaquín [1] https://github.com/openSUSE/mentoring/issues/79 [2] https://github.com/yast/yast-country/blob/master/keyboard/src/modules/Keyboa... [3]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_... [4]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_... -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 05/23/2018 10:32 PM, Joaquín wrote:
Hi all,
Hi. First of all, let me apologize for the huge delay in the reply. The whole YaST Team at SUSE was first in a Team Workshop at the SUSE Headquarters at Prague and then in the openSUSE Conference 2018. So not much time to take care of the mailing list.
I am Joaquín and I am working on a rewrite of YaST keyboard module, info here [1]. In a nutshell, I am writing a keyboard module for YaST with ruby using OOD, with an implementation for SystemD. Right now i am looking to map the code of every keyboard layout (for example: us, es, us-dvorak) with their human readable translation ( “English (US)”, “Spanish”,...), but i have some questions about it. I have taken a look to the existing code to try to use the same translations. And i found two files, “keyboard_raw_opensuse.ycp” and “keyboard_raw.ycp”. Also i found the part of the code that is using one of these two files [2]. The only difference between these files i see, is that in some cases, for a language one file uses a .map.gz file and the other use a different .map.gz, for example with “spanish-lat” see [3] and [4].
I think that with only one map for each code is enough for an implementation with SystemD but i am not sure, because I don’t understand the reason of these differences in the current module. It would be nice if some of you can explain to me so i can understand it, and apply a good solution in the project.
The reason is that openSUSE was migrated to a different set of console fonts and keyboard mappings before SLE did the same transition. At some point we needed to keep the old conservative fonts and keyboard maps for SLE and to offer new ones for openSUSE. We introduced the change here. https://github.com/yast/yast-country/pull/104 That was just a transition period. At a later point in time, the console fonts were re-unified. https://github.com/yast/yast-country/pull/161 Not sure why the keymaps were not re-unified in the same way. But now that SLE and openSUSE Leap are closer than ever, I can't see a reason for them to diverge again.
Also in the case that is only needed one mapping, which of those files should i take as reference?
I would go for keyboard_raw. And just in case you have not done it already, please migrate it to a sane format like Yaml containing only the information that is still relevant nowadays.
Thank you all, Joaquín
Thank you for the great work.
[1] https://github.com/openSUSE/mentoring/issues/79 [2] https://github.com/yast/yast-country/blob/master/keyboard/src/modules/Keyboa...
[3]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_...
[4]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_...
-- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 29/05/18 11:19, Ancor Gonzalez Sosa wrote:
On 05/23/2018 10:32 PM, Joaquín wrote:
Hi all,
Hi thanks for your reply. How was the openSUSE Conference 2018? I hope you have had a good time :)
Hi. First of all, let me apologize for the huge delay in the reply. The whole YaST Team at SUSE was first in a Team Workshop at the SUSE Headquarters at Prague and then in the openSUSE Conference 2018. So not much time to take care of the mailing list.
I am Joaquín and I am working on a rewrite of YaST keyboard module, info here [1]. In a nutshell, I am writing a keyboard module for YaST with ruby using OOD, with an implementation for SystemD. Right now i am looking to map the code of every keyboard layout (for example: us, es, us-dvorak) with their human readable translation ( “English (US)”, “Spanish”,...), but i have some questions about it. I have taken a look to the existing code to try to use the same translations. And i found two files, “keyboard_raw_opensuse.ycp” and “keyboard_raw.ycp”. Also i found the part of the code that is using one of these two files [2]. The only difference between these files i see, is that in some cases, for a language one file uses a .map.gz file and the other use a different .map.gz, for example with “spanish-lat” see [3] and [4].
I think that with only one map for each code is enough for an implementation with SystemD but i am not sure, because I don’t understand the reason of these differences in the current module. It would be nice if some of you can explain to me so i can understand it, and apply a good solution in the project.
The reason is that openSUSE was migrated to a different set of console fonts and keyboard mappings before SLE did the same transition. At some point we needed to keep the old conservative fonts and keyboard maps for SLE and to offer new ones for openSUSE. We introduced the change here. https://github.com/yast/yast-country/pull/104
That was just a transition period. At a later point in time, the console fonts were re-unified. https://github.com/yast/yast-country/pull/161
Not sure why the keymaps were not re-unified in the same way. But now that SLE and openSUSE Leap are closer than ever, I can't see a reason for them to diverge again.
Also in the case that is only needed one mapping, which of those files should i take as reference?
I would go for keyboard_raw. And just in case you have not done it already, please migrate it to a sane format like Yaml containing only the information that is still relevant nowadays.
As you suggested, I migrated the layouts information to a yaml file. But I found that there are some layouts in the keyboard_raw that does not appear when executing "localectl list-keymaps" or "localectl list-x11-keymap-layouts", so i think that do not exist. Exactly are this: khmer.map.gz korean.map.gz arabic.map.gz taiwanese.map.gz chinese.map.gz I migrated that ones too, but right now in the new module these layouts does not appear in the lists that is shown to the user. Is this what is supposed that should happen? Also I found that in keyboard_raw file "Portuguese (Brazil -- US accents)" and "US International" use the same layout "us-acentos.map.gz". Is this ok? Should both of them appear to the user or it is enough with one of them? Additionally I have been looking a way to implement the “Expert settings”. That expert settings are repeat rate and delay, numlock on/off and disable/enable caps Lock. But i found that systemd-localed does not manage that, so i suppose that the idea is to do it in the same that in the current module. As i can see in the code, to manage that values only is needed to write the values in “/etc/sysconfig/keyboard”, I am right?
Thank you all, Joaquín
Thank you for the great work.
Thanks for your help.
[1] https://github.com/openSUSE/mentoring/issues/79 [2] https://github.com/yast/yast-country/blob/master/keyboard/src/modules/Keyboa...
[3]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_...
[4]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_...
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
V Mon, 4 Jun 2018 21:21:13 +0100 Joaquín <joaquinmnsm@gmail.com> napsáno:
On 29/05/18 11:19, Ancor Gonzalez Sosa wrote:
On 05/23/2018 10:32 PM, Joaquín wrote:
Hi all,
Hi thanks for your reply. How was the openSUSE Conference 2018? I hope you have had a good time :)
Hi. First of all, let me apologize for the huge delay in the reply. The whole YaST Team at SUSE was first in a Team Workshop at the SUSE Headquarters at Prague and then in the openSUSE Conference 2018. So not much time to take care of the mailing list.
I am Joaquín and I am working on a rewrite of YaST keyboard module, info here [1]. In a nutshell, I am writing a keyboard module for YaST with ruby using OOD, with an implementation for SystemD. Right now i am looking to map the code of every keyboard layout (for example: us, es, us-dvorak) with their human readable translation ( “English (US)”, “Spanish”,...), but i have some questions about it. I have taken a look to the existing code to try to use the same translations. And i found two files, “keyboard_raw_opensuse.ycp” and “keyboard_raw.ycp”. Also i found the part of the code that is using one of these two files [2]. The only difference between these files i see, is that in some cases, for a language one file uses a .map.gz file and the other use a different .map.gz, for example with “spanish-lat” see [3] and [4].
I think that with only one map for each code is enough for an implementation with SystemD but i am not sure, because I don’t understand the reason of these differences in the current module. It would be nice if some of you can explain to me so i can understand it, and apply a good solution in the project.
The reason is that openSUSE was migrated to a different set of console fonts and keyboard mappings before SLE did the same transition. At some point we needed to keep the old conservative fonts and keyboard maps for SLE and to offer new ones for openSUSE. We introduced the change here. https://github.com/yast/yast-country/pull/104
That was just a transition period. At a later point in time, the console fonts were re-unified. https://github.com/yast/yast-country/pull/161
Not sure why the keymaps were not re-unified in the same way. But now that SLE and openSUSE Leap are closer than ever, I can't see a reason for them to diverge again.
Also in the case that is only needed one mapping, which of those files should i take as reference?
I would go for keyboard_raw. And just in case you have not done it already, please migrate it to a sane format like Yaml containing only the information that is still relevant nowadays.
Hi Joaquim,
As you suggested, I migrated the layouts information to a yaml file. But I found that there are some layouts in the keyboard_raw that does not appear when executing "localectl list-keymaps" or "localectl list-x11-keymap-layouts", so i think that do not exist. Exactly are this:
khmer.map.gz korean.map.gz arabic.map.gz taiwanese.map.gz chinese.map.gz
As all of them are a bit specific, I think you need to check old code if it does not install additiona rpm for it which defines this keymaps, so maybe after installing this additional rpms it can make it available.
I migrated that ones too, but right now in the new module these layouts does not appear in the lists that is shown to the user. Is this what is supposed that should happen?
if it needs additional software, then it should be there and when selected inform user that also additional software will be installed.
Also I found that in keyboard_raw file "Portuguese (Brazil -- US accents)" and "US International" use the same layout "us-acentos.map.gz". Is this ok? Should both of them appear to the user or it is enough with one of them?
Well, It depends. If you are brazil with us accents, do you expect that you select some US international or named for you? Maybe we also in past use it for linking it with language selection.
Additionally I have been looking a way to implement the “Expert settings”. That expert settings are repeat rate and delay, numlock on/off and disable/enable caps Lock. But i found that systemd-localed does not manage that, so i suppose that the idea is to do it in the same that in the current module. As i can see in the code, to manage that values only is needed to write the values in “/etc/sysconfig/keyboard”, I am right?
Sorry, this is out of my knowledge and you probably should check some documentation or ask on general opensuse mailing list how to achieve it. Josef
Thank you all, Joaquín
Thank you for the great work.
Thanks for your help.
[1] https://github.com/openSUSE/mentoring/issues/79 [2] https://github.com/yast/yast-country/blob/master/keyboard/src/modules/Keyboa...
[3]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_...
[4]https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboard_...
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
2018.06.05 11:54, Josef Reidinger rašė:
As you suggested, I migrated the layouts information to a yaml file. But I found that there are some layouts in the keyboard_raw that does not appear when executing "localectl list-keymaps" or "localectl list-x11-keymap-layouts", so i think that do not exist. Exactly are this:
khmer.map.gz korean.map.gz arabic.map.gz taiwanese.map.gz chinese.map.gz As all of them are a bit specific, I think you need to check old code if it does not install additiona rpm for it which defines this keymaps, so maybe after installing this additional rpms it can make it available.
If I remember corectly, it seems thees are mere symlinks to us keyboard layout. E.g. "arabic": /usr/share/kbd/keymaps/legacy/i386/qwerty/arabic.map.gz -> /usr/share/kbd/keymaps/legacy/i386/qwerty/us.map.gz "khmer": /usr/share/kbd/keymaps/legacy/i386/qwerty/khmer.map.gz -> /usr/share/kbd/keymaps/legacy/i386/qwerty/us.map.gz This is from comment at https://bugzilla.suse.com/show_bug.cgi?id=942896#c60 -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Thanks for your help, and sorry for my delay on replying. On 05/06/18 10:10, opensuse.lietuviu.kalba wrote:
2018.06.05 11:54, Josef Reidinger rašė:
As you suggested, I migrated the layouts information to a yaml file. But I found that there are some layouts in the keyboard_raw that does not appear when executing "localectl list-keymaps" or "localectl list-x11-keymap-layouts", so i think that do not exist. Exactly are this:
khmer.map.gz korean.map.gz arabic.map.gz taiwanese.map.gz chinese.map.gz As all of them are a bit specific, I think you need to check old code if it does not install additiona rpm for it which defines this keymaps, so maybe after installing this additional rpms it can make it available.
If I remember corectly, it seems thees are mere symlinks to us keyboard layout. E.g.
"arabic": /usr/share/kbd/keymaps/legacy/i386/qwerty/arabic.map.gz -> /usr/share/kbd/keymaps/legacy/i386/qwerty/us.map.gz
"khmer": /usr/share/kbd/keymaps/legacy/i386/qwerty/khmer.map.gz -> /usr/share/kbd/keymaps/legacy/i386/qwerty/us.map.gz
This is from comment at https://bugzilla.suse.com/show_bug.cgi?id=942896#c60
Thanks, that clarifies my question. Also in the bug report i have read that the console font its managed from in the "Language" module (in this comment https://bugzilla.suse.com/show_bug.cgi?id=942896#c7 ), so i it is not necessary to manage when selecting a keyboard layout.
Also I found that in keyboard_raw file "Portuguese (Brazil -- US accents)" and "US International" use the same layout "us-acentos.map.gz". Is this ok? Should both of them appear to the user or it is enough with one of them?
Well, It depends. If you are brazil with us accents, do you expect that you select some US international or named for you? Maybe we also in past use it for linking it with language selection.
About this in a first moment i thought that i was better to show it as "US international" since this module is to set the keyboard layout of the system, not the user one. But i will keep the same behaviour that is in the current module and i will allow the possibility of have several options for one layout. Just for your information, i will look for more information about the "Expert settings" that i commented in the other messages. Thanks you again! -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (4)
-
Ancor Gonzalez Sosa
-
Joaquín
-
Josef Reidinger
-
opensuse.lietuviu.kalba