[virt-tools-list] [libosinfo 1/2] install-config: Document expected kbd layout format

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Fri Nov 30 15:38:16 UTC 2012


On Fri, Nov 30, 2012 at 5:03 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> On Fri, Nov 30, 2012 at 04:30:16PM +0200, Zeeshan Ali (Khattak) wrote:
>> On Fri, Nov 30, 2012 at 11:37 AM, Christophe Fergeau
>> <cfergeau at redhat.com> wrote:
>> >This API seems to be very fedora-specific,
>>
>> The format is more like Linux specific but yeah, currently we only
>> need this for Fedora and 'keyboard' command is required in the
>> kickstart.
>
> Ubuntu (and Debian as well I guess) uses a similar but different format,
> 'layout_variant' as opposed to the 'layout (variant)' that you suggest
> using in the public API.

We can easily translate it to their format then?

> XkbLayout seems to be quite close to a country
> code, so is easy to get from a 'gettext' format.

I don't know if i got this. You mean we can guess/derive layout from
l10-language param?

>> > the way it works on win7
>> > is described there:
>> > http://technet.microsoft.com/fr-fr/library/cc749191%28v=ws.10%29.aspx
>> > though I did not quite get the format of keyboard layouts
>> >
>> >  void osinfo_install_config_set_l10n_keyboard(OsinfoInstallConfig *config,
>> >                                               const gchar *locale,
>> >                                               const gchar *keyboard_layout);
>> > will probably be more flexible. 'locale' would be in the same 'gettext'
>> > format as in other places. Not sure at all what the format of
>> > keyboard_layout should be, just that it can be NULL to use the default
>> > keyboard layout (which is what we'll want most of the time).
>>
>> IMO for now we shouldn't set the keyboard layout for windows since its
>> autodeteced (right?) from the language params that we do set. We also
>> have the API for apps to know if a param is used by a script or not
>> and if it is used, if its mandatory.
>>
>> If we decide to do so in future, we could either figure a way to
>> translate from X layouts to locale names or add new param/API to
>> set/get locale and declare in windows scripts that they make use of
>> this param.
>
> After looking at how Ubuntu does things, having 2 arguments seems it will
> make things less convoluted...

while breaking API. From what you said above, I don't see how we cant
easily use the same API for Ubuntu/Debian.

> And I'd prefer if we spent a bit of time
> trying to get the API right now.

The API is already there, I'm just trying to decide/fix a format for
the argument/param involved. I'm afraid you have missed the best
opportunity for discussing these APIs in detail: when they were
proposed by Daniel for the first time many months ago.

> This API is also missing a way to handle multiple layouts, which at least
> Windows and Fedora support, I don't know if this is on purpose?

Thats something Daniel can answer with certainty but:

a. That should be easy to add support for without breaking API/ABI
(e.g allow comma separated list of layouts as the param) later.
b. I don't think its very important to allow that so I'll rather leave
that out for now.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the virt-tools-list mailing list