[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Adding new language/locale to system via a graphical interface



On Mon, 03 Jan 2022 at 15:29:06 +0530, Pirate Praveen wrote:
> I need to run xhost + to be able to launch this

`xhost +` is rarely (never?) the right answer. If you want GUIs running
as root to be able to connect to your X11 display, instead use:

    xhost +si:localuser:root

Of course, running GUIs as root is all sorts of dangerous anyway,
because X11 is a complicated protocol and X11 clients implicitly trust
your X11 server... but at least please don't let unprivileged users like
www-data@localhost access your X11 display.

The more modern way to do this would be to have an unprivileged UI that
submits requests to a privileged service via some sort of IPC protocol
(like the way e.g. GNOME components configure networking by talking to
NetworkManager), which doesn't require the GUI to have special privileges.

localectl(1) has this design, with localectl talking to the
systemd-localed service, and GNOME Settings (gnome-control-center) can
also set the system locale in the same way localectl does. I'm sure other
desktop environments' equivalents are similar.

Enabling new locales is not currently included in systemd-localed's
functionality, presumably because it's distro-specific how you do this
most correctly: on Ubuntu (and I think also Fedora) you'd install a
pre-generated "language pack" package, but on Debian or Arch you'd edit
/etc/locale.gen and run localegen.

Installing locales-all is also an option, although unfortunately it's
more than 200M (most of which seems to be LC_COLLATE rules, which are
presumably stored in a time-efficient but space-inefficient format).

If we had a locales-utf8 package that was a subset of locales-all
with only the (recommended) UTF-8 locales, it would be half the size -
perhaps that would be a better default for desktop systems?

See also <https://bugs.debian.org/701585>.

    smcv


Reply to: