Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2014 13:13:25 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        Stefan Esser <se@freebsd.org>
Cc:        "Andrey V. Elsukov" <ae@freebsd.org>, Aleksandr Rybalko <ray@ddteam.net>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Keymap definitions for VT / NEWCONS
Message-ID:  <CAPyFy2B6bqiRnqv5kURUYhcGbtR-NqzUcuLDFntPXH4ChnS0mQ@mail.gmail.com>
In-Reply-To: <53ECA9CE.3070106@freebsd.org>
References:  <53EA0EC2.2070601@freebsd.org> <53EA1E5A.5020707@FreeBSD.org> <53EA2D00.7010307@freebsd.org> <CAPyFy2DMtFhwosD4z4sVHANB3Bp9_kECNrMWHOH=VpJiPyg2aQ@mail.gmail.com> <53EB0DA0.5000305@freebsd.org> <CAPyFy2BsMzvoYdNiYmRb6RTB_=TzDBoCW7PVETchuNirTJ%2BS2g@mail.gmail.com> <53EBEDC8.3080303@freebsd.org> <CAPyFy2DY20CJA6zc18%2Beie7%2BAm5UOV3ucu4vbirFhwcxgptttg@mail.gmail.com> <53ECA9CE.3070106@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14 August 2014 08:21, Stefan Esser <se@freebsd.org> wrote:
> There probably won't be a 1:1 mapping for all cases, but I think
> that there is value in going for a regular naming scheme.
>
> We can use "fr.kbd" as a short form of "fr_FR.kbd", but there
> will be a "fr_CH.kbd" and possibly a "fr_CA.kbd". The "fr" in
> the short form will correspond to the "FR" in "fr_FR.kbd",
> which is hidden by the fact, that both parts read "fr".

I agree that consistency is a useful overall goal, and I don't have a
very strong preference for the short names, it just seems to me to map
well to what it seems users actually call the keyboard layouts.
French, Swiss French, and French Canadian keyboard layouts in these
three cases. Also, Linux console setting seems to generally use
2-letter names as far as I can tell.

Would every locale we support have either a file or symlink?  Or only
a subset, roughly equivalent to what's provided by the syscons keymaps
today?

> But look at "uk_UA.kbd", which will be short-named as "ua.kbd",
> or "be_BY.kbd" mapped to "by.kbd" versus "nl_BE.kbd" mapped to
> "be.kbd".
>
> For some language/country combinations, the short form ends up
> in a distant location to the long form names.

But I expect most users would choose from a menu without seeing the
underlying keymap filename anyway, so I don't think this matters much.

> And will there be a "ch.kbd" for "de_CH.kbd" (the majority of
> Swiss users will use that keymap), or will they all be of the
> form "??_CH.kbd" ... ???

I would assume ??_CH.kbd since I suspect users would generally not
refer to a "Swiss" keyboard layout, but rather a "Swiss German" or
"Swiss French" layout.  (I'm happy to be corrected if wrong.)

> For all these reasons I think the short form serves no real
> purpose. If you want to support it, you could symlink a short
> name to the locale based name (to allow the use of just the
> country code, if people edit rc.conf by hand, while I'd expect
> the installer to use the locale based keyboard names).

If we do end up with locale names I don't think there's much value in
having short name symlinks.  It's just another level of indirection
that needs to be kept up to date.

> I think this should be implemented in time for 10.1, if at
> all possible.

Indeed, that is exactly why I wanted to move ahead with the "trivial"
cases, even if they turned out not to be so.  I'm sorry for the
conflict that caused with your work in progress.

> Most users will either use the installer (and will thus
> never see the locale IDs)

I think we agree that for these users it makes very little difference
what the keymap name actually is, since they won't see it.

> or they'll manually edit rc.conf and will know their way.

And in this case I think the country codes are often the way these
users think of a layout, with a few cases where more specific names
are needed. For example, I wouldn't think of a US English keyboard,
but just a US keyboard, and similarly for a French keyboard. I would
not expect to look for a Canadian English keyboard, but would look for
a Canadian French or Canadian Bilingual keyboard.

> And then it's easier to mechanically
> put the locale ID in to the keyboard selection variable,
> instead of thinking about (or looking up) whether this is
> a country that does not need the full locale ID to select
> a keymap.

But then we either need to provide symlinks for all locale names, or
the user needs to determine if their locale is one which has a keymap
or not. And there may be ambiguities in the "default" symlink mapping;
for instance, there are arguments to be made to symlink en_CA to
either en_US or fr_CA.

> In Europe, you'll often need the locale name,
> not only the country.

We don't seem to have many cases of this in the existing syscons
keymaps, but you certainly understand this better than I do; perhaps
this will be an issue when adding more keymaps.

> I really think we'll regret using anything but locale names
> for keymaps, and I'd want to rename those that you committed
> under 2-letter ISO names. Is that acceptable to you?

The worry I have with using locale names is that it implies there is a
1:1 mapping, which is sometimes true and sometimes not.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2B6bqiRnqv5kURUYhcGbtR-NqzUcuLDFntPXH4ChnS0mQ>