locales in ubutu package

nicolaslebrun
Beiträge: 95
Registriert: 18 Apr 2011, 11:43

locales in ubutu package

Beitragvon nicolaslebrun » 17 Sep 2020, 11:39

In ubuntu package, locales generation is very long lasting

in ubuntu.py, there's

Code: Alles auswählen

# Generate and set locales
# This will lead to generating all locales:
cmds.append("cat /usr/share/i18n/SUPPORTED > /etc/locale.gen")
cmds.append('echo "locales locales/default_environment_locale      select  %s" | debconf-set-selections' % locale)


replace the line

Code: Alles auswählen

cmds.append("cat /usr/share/i18n/SUPPORTED > /etc/locale.gen")

with

Code: Alles auswählen

cmds.append('cat /usr/share/i18n/SUPPORTED |grep "en_US.UTF-8\|%s" > /etc/locale.gen' % locale)

seems to work and is sufficient to me...

What do you think?

Regards,
Nico Lebrun

Benutzeravatar
m.radtke
uib-Team
Beiträge: 962
Registriert: 10 Jun 2015, 12:19

Re: locales in ubutu package

Beitragvon m.radtke » 18 Sep 2020, 09:11

Hi Nicolas
thanks for your feedback.

I think this needs a bit of adaption to make it work for more than US locales, but your suggestion is something to consider :)

Regards
Mathias
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.

nicolaslebrun
Beiträge: 95
Registriert: 18 Apr 2011, 11:43

Re: locales in ubutu package

Beitragvon nicolaslebrun » 09 Feb 2021, 15:56

Hi,

i do the same in debian.py

Code: Alles auswählen

cmds.append('cat /usr/share/i18n/SUPPORTED |grep "en_US.UTF-8\|%s" > /etc/locale.gen' % locale)


It leads to generate the locale i can select in the property "language" of the package.

With fr as language, it leads to a locale.gen that contain

en_US.UTF-8
fr_FR.UTF-8

It looks sufficient to me, isn't it ?

regards,
Nico