• Adding new language/locale to system via a graphical interface

    From Pirate Praveen@21:1/5 to All on Sun Jan 2 22:40:01 2022
    Hi,

    I'm looking for a way to add a new locale/language to system from gnome
    (think about gnome on mobile like Purism Librem 5 or Pine Phone). I can
    do that from a terminal by running dpkg-reconfigure locales but want to
    provide an easier option to users. Is there a way to force gtk
    interface of debconf and launch it from graphical interface? In Ubuntu,
    there is separate add language tool which can add new languages.

    Thanks
    Praveen

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Pentchev@21:1/5 to Pirate Praveen on Sun Jan 2 23:20:01 2022
    On Mon, Jan 03, 2022 at 02:59:26AM +0530, Pirate Praveen wrote:
    Hi,

    I'm looking for a way to add a new locale/language to system from gnome (think about gnome on mobile like Purism Librem 5 or Pine Phone). I can do that from a terminal by running dpkg-reconfigure locales but want to provide an easier option to users. Is there a way to force gtk interface of debconf and launch it from graphical interface? In Ubuntu, there is separate add language tool which can add new languages.

    The debconf(7) manual page suggests that setting DEBIAN_FRONTEND=gnome
    after installing the libgtk3-perl package ought to work, and it seems to
    work for me:

    sudo env DEBIAN_FRONTEND=gnome dpkg-reconfigure locales

    ...brings up a GTK+ interface.

    G'luck,
    Peter

    --
    Peter Pentchev roam@ringlet.net roam@debian.org pp@storpool.com
    PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
    Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAmHSIoAACgkQZR7vsCUn 3xPrpg//ekd/JU8WoKriqVU45QDq65lym7ko8Y3xJDKFlMWsG3Xy8FZNx17Z9I9L tZt1OKFRPld8A60BBDV1U2GBl0UcTFv/JTW+yqxe22GwaM51TR3MtmcCyJdviZl/ 8+mA1A0LkDYcfIIwKsqDa7QthDZxIj0VbLBcnDSw3/+hKYyy934X6rR4rmUBl+8u Eah0dTrnpitZZOfJRtnQ+mVHNy2/gQ8Qd+DRlHC19ImP3yZwxobrZa0Gw/3g8KW9 9TsJeEYAU2DqYc/SpASRQ6hwZMnKNQ2bgOQhund3PrP1YCVHI1ah5bGHkEKhy2pn qwoI/anlYtvZl1ORFpB2y93kYl4u98kPFZU9+8i6qbvdfwQZxUq/A7vok4seSYHA 2JLQTvxt8iLEwpA1utP19yXRKRYT8Deah/QO+yrE0/AZIrDMdzGjyvzq132s4npe 6RF/hUNO3Ic11Cli/Td+iYem4AoBJqKSTMleLR0pRaN7XjkrxbdJI2DhHFZBtH7r 0Gl4GleC/WAJuwFXZkNR0FPQ3SJmzka2XGApZxlqbdHf8R0n947IvCAYIEGP3B6K 9zU+u+RaDEdCVvMa6Sjyw2Jnym1RBdJ/fzBcjT6gYZA2ZKBn5hkHA6YWoYyS841I SEuc1QKnlgVUS++HsJwYZttol5Z1qrK7KdMjIyyKc2MAAEGokdc=
    =YSDY
    -
  • From Pirate Praveen@21:1/5 to Peter Pentchev on Mon Jan 3 11:00:02 2022
    On തി, ജനു 3 2022 at 12:09:10 രാവിലെ +0200 +0200,
    Peter Pentchev <roam@ringlet.net> wrote:
    On Mon, Jan 03, 2022 at 02:59:26AM +0530, Pirate Praveen wrote:
    Hi,

    I'm looking for a way to add a new locale/language to system from
    gnome
    (think about gnome on mobile like Purism Librem 5 or Pine Phone). I
    can do
    that from a terminal by running dpkg-reconfigure locales but want
    to provide
    an easier option to users. Is there a way to force gtk interface of
    debconf
    and launch it from graphical interface? In Ubuntu, there is
    separate add
    language tool which can add new languages.

    The debconf(7) manual page suggests that setting DEBIAN_FRONTEND=gnome
    after installing the libgtk3-perl package ought to work, and it seems
    to
    work for me:

    sudo env DEBIAN_FRONTEND=gnome dpkg-reconfigure locales

    ...brings up a GTK+ interface.


    Thanks! I need to run xhost + to be able to launch this. Is there
    another way to lauch this graphically without having to run xhost +.
    May be something using policykit?

    I remember there used to be a gksu or gksudo but can't find this now

    apt-file find bin/gksu
    apt-file find bin/gksudo

    pkexec env DEBIAN_FRONTEND=gnome /usr/sbin/dpkg-reconfigure locales
    Unable to init server: Could not connect: Connection refused

    (dpkg-reconfigure:159177): Gtk-WARNING **: 15:28:06.343: cannot open
    display:
    debconf: unable to initialize frontend: Gnome
    debconf: (DISPLAY problem?)
    debconf: falling back to frontend: Dialog


    G'luck,
    Peter

    --
    Peter Pentchev roam@ringlet.net roam@debian.org pp@storpool.com
    PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
    Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wouter Verhelst@21:1/5 to Pirate Praveen on Thu Jan 6 10:00:01 2022
    Hi,

    On Mon, Jan 03, 2022 at 03:29:06PM +0530, Pirate Praveen wrote:


    On തി, ജനു 3 2022 at 12:09:10 രാവിലെ +0200 +0200, Peter Pentchev
    <roam@ringlet.net> wrote:
    On Mon, Jan 03, 2022 at 02:59:26AM +0530, Pirate Praveen wrote:
    Hi,

    I'm looking for a way to add a new locale/language to system from
    gnome
    (think about gnome on mobile like Purism Librem 5 or Pine Phone). I
    can do
    that from a terminal by running dpkg-reconfigure locales but want
    to provide
    an easier option to users. Is there a way to force gtk interface of debconf
    and launch it from graphical interface? In Ubuntu, there is
    separate add
    language tool which can add new languages.

    The debconf(7) manual page suggests that setting DEBIAN_FRONTEND=gnome after installing the libgtk3-perl package ought to work, and it seems to work for me:

    sudo env DEBIAN_FRONTEND=gnome dpkg-reconfigure locales

    ...brings up a GTK+ interface.


    Thanks! I need to run xhost + to be able to launch this. Is there another
    way to lauch this graphically without having to run xhost +. May be
    something using policykit?

    If you drop the "env" in that command, then the XAUTHORITY environment
    variable will be retained and you shouldn't need to muck about with X authorization.

    --
    w@uter.{be,co.za}
    wouter@{grep.be,fosdem.org,debian.org}

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pirate Praveen@21:1/5 to All on Thu Jan 6 13:00:02 2022
    2022, ജനുവരി 6 2:26:33 PM IST, Wouter Verhelst <wouter@debian.org>ൽ എഴുതി
    Hi,

    On Mon, Jan 03, 2022 at 03:29:06PM +0530, Pirate Praveen wrote:


    On തി, ജനു 3 2022 at 12:09:10 രാവിലെ +0200 +0200, Peter Pentchev
    <roam@ringlet.net> wrote:
    On Mon, Jan 03, 2022 at 02:59:26AM +0530, Pirate Praveen wrote:
    Hi,

    I'm looking for a way to add a new locale/language to system from
    gnome
    (think about gnome on mobile like Purism Librem 5 or Pine Phone). I
    can do
    that from a terminal by running dpkg-reconfigure locales but want
    to provide
    an easier option to users. Is there a way to force gtk interface of
    debconf
    and launch it from graphical interface? In Ubuntu, there is
    separate add
    language tool which can add new languages.

    The debconf(7) manual page suggests that setting DEBIAN_FRONTEND=gnome
    after installing the libgtk3-perl package ought to work, and it seems to >> > work for me:

    sudo env DEBIAN_FRONTEND=gnome dpkg-reconfigure locales

    ...brings up a GTK+ interface.


    Thanks! I need to run xhost + to be able to launch this. Is there another
    way to lauch this graphically without having to run xhost +. May be
    something using policykit?

    If you drop the "env" in that command, then the XAUTHORITY environment >variable will be retained and you shouldn't need to muck about with X >authorization.


    In Pure OS, the plan is to use systemd-localed and it was just a regression https://source.puri.sm/Librem5/gnome-control-center/-/issues/124#note_183751 so we don't need to reconfigure locales for adding locale.
    --
    Sent from my Android device with K-9 Mail. Please excuse my brevity.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Pirate Praveen on Thu Jan 6 12:20:01 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Simon McVittie on Thu Jan 6 13:20:02 2022
    On Thu, 06 Jan 2022 at 11:09:30 +0000, Simon McVittie wrote:
    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?

    https://bugs.debian.org/1003213

    smcv

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurent Bigonville@21:1/5 to Praveen on Thu Jan 6 15:00:04 2022
    Praveen wrote:

    Hi,

    Hello,

    I'm looking for a way to add a new locale/language to system from
    gnome (think about gnome on mobile like Purism Librem 5 or Pine Phone).
    I can do that from a terminal by running dpkg-reconfigure locales but
    want to provide an easier option to users. Is there a way to force gtk interface of debconf and launch it from graphical interface? In Ubuntu,
    there is separate add language tool which can add new languages.

    You could also try to install the locales-all package (that would pull
    232MB extra) and the you could use gnome-control-center to configure the locales per user?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)