diff mbox series

[bug#70280,3/5] locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.

Message ID c3d39296e091348f32ccfee671cf2918b5752424.1712585810.git.ludo@gnu.org
State New
Headers show
Series Reducing system size: locales and initrd | expand

Commit Message

Ludovic Courtès April 8, 2024, 2:24 p.m. UTC
This reduces the default set of locales from 92 MiB to 28 MiB.

* gnu/system/locale.scm (%default-locale-definitions): Reduce to 10
locales.

Change-Id: I3c092604301d69db591957bcfd62a062c3ac5ab0
---
 gnu/system/locale.scm | 56 ++++++++++++-------------------------------
 1 file changed, 15 insertions(+), 41 deletions(-)

Comments

pelzflorian (Florian Pelz) April 9, 2024, 7:38 p.m. UTC | #1
Hello Ludo.  Even though with my base commit I get 70MB more than you do
(from 1460.5MB down to 1296.1MB), your patches still bring good
improvement.

So (operating-system-locale-definitions os) can now be changed to
something other than operating-system-locale-definitions that does not
include locale.  Perhaps this is useful when one does not want utf8 but
EUC-JP like in the “info "(guix)Locales"”?  Okay.

I agree with shrinking default locales, but do not understand what
benefit it brings that U.N. languages are always included.  Perhaps it
would be more useful to include en_US only?  Locales like fr_CA and
ar_JO do not even have separate teams on translationproject.org.  There
are reasons for developers to include interesting locales for testing
like tr_TR or az_AZ, where capitalized i is İ and small I is ı, breaking
all kinds of programs, but few people would know.

Regards,
Florian
Ludovic Courtès April 15, 2024, 4:22 p.m. UTC | #2
Guten Tag Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> I agree with shrinking default locales, but do not understand what
> benefit it brings that U.N. languages are always included.  Perhaps it
> would be more useful to include en_US only?

My idea was to include by default a few locales that people may
“typically” find useful, in addition to their chosen one.

Of course, it’s an arbitrary choice (choosing the six UN languages makes
it slightly less arbitrary).

> Locales like fr_CA and
> ar_JO do not even have separate teams on translationproject.org.  There
> are reasons for developers to include interesting locales for testing
> like tr_TR or az_AZ, where capitalized i is İ and small I is ı, breaking
> all kinds of programs, but few people would know.

My goal is *not* to provide a default set useful for developers
(otherwise German, Greek, Turkish, and non-UTF-8 locales would be
welcome).

Now, should we remove fr_CA and ar_JO?  Maybe!  I’m open to really any
changes in this list; I just think it should go beyond en_US.

Thoughts?

Ludo’.
pelzflorian (Florian Pelz) April 15, 2024, 10:32 p.m. UTC | #3
Bonjour Ludo. :)

Ludovic Courtès <ludo@gnu.org> writes:
> Guten Tag Florian,
>
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>
>> I agree with shrinking default locales, but do not understand what
>> benefit it brings that U.N. languages are always included.  Perhaps it
>> would be more useful to include en_US only?
>
> My idea was to include by default a few locales that people may
> “typically” find useful, in addition to their chosen one.

Hmm but how would they use it?  Ohh I just noticed that these languages
configured here will be the options in the GNOME Settings.  I do agree
now that the six languages are a standard set, although Russian has less
speakers than Portuguese [1], which gets discussed [2] and I would tend
to also include Portuguese then, because it has translations unlike
Bengali or Hindi.


> Of course, it’s an arbitrary choice (choosing the six UN languages makes
> it slightly less arbitrary).
>
>> Locales like fr_CA and
>> ar_JO do not even have separate teams on translationproject.org.  There
>> are reasons for developers to include interesting locales for testing
>> like tr_TR or az_AZ, where capitalized i is İ and small I is ı, breaking
>> all kinds of programs, but few people would know.
>
> My goal is *not* to provide a default set useful for developers
> (otherwise German, Greek, Turkish, and non-UTF-8 locales would be
> welcome).
>
> Now, should we remove fr_CA and ar_JO?  Maybe!  I’m open to really any
> changes in this list; I just think it should go beyond en_US.
>
> Thoughts?
>
> Ludo’.

I would remove ar_JO.  Probably also remove fr_CA, because someone from
Canada will configure fr_CA during Guix installation.

Regards,
Florian

[1]
https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers

[2]
https://en.wikipedia.org/wiki/Official_languages_of_the_United_Nations
Ludovic Courtès April 17, 2024, 3:20 p.m. UTC | #4
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:

[...]

>> My idea was to include by default a few locales that people may
>> “typically” find useful, in addition to their chosen one.
>
> Hmm but how would they use it?

I don’t use a desktop environment; my use case would be:

  export LC_ALL=…

or, say:

  LANGUAGE=fr:es:en

> Ohh I just noticed that these languages configured here will be the
> options in the GNOME Settings.  I do agree now that the six languages
> are a standard set, although Russian has less speakers than Portuguese
> [1], which gets discussed [2] and I would tend to also include
> Portuguese then, because it has translations unlike Bengali or Hindi.

Yeah, the UN language choice is base on imperialism more than
popularity.

> I would remove ar_JO.  Probably also remove fr_CA, because someone from
> Canada will configure fr_CA during Guix installation.

OK, let’s drop these two and add pt_BR and pt_PT then.

Thanks!

Ludo’.
Ludovic Courtès April 29, 2024, 10:30 p.m. UTC | #5
Hi Florian,

I pushed this series as 5f89f45e7465ebbdc84c925ea3cfaec5dd06ed88,
following the two suggestions you made:

  • Dropping the controversial patch that changed whether the system
    locale would be include.

  • Dropping two “redundant” locales and adding two Portuguese locales
    to the default set.

Thanks again!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index 4ea82e24d5..00eb902702 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -153,9 +153,10 @@  (define %default-locale-libcs
       (list glibc)))
 
 (define %default-locale-definitions
-  ;; Arbitrary set of locales that are built by default.  They are here mostly
-  ;; to facilitate first-time use to some people, while others may have to add
-  ;; a specific <locale-definition>.
+  ;; Arbitrary set of locales that are built by default.  They come as a
+  ;; "bonus" in addition to that specified in the 'locale' field of the
+  ;; operating system, for the user's convenience, so they shouldn't take too
+  ;; much space.
   (letrec-syntax ((utf8-locale (syntax-rules ()
                                  ((_ name*)
                                   (locale-definition
@@ -167,44 +168,17 @@  (define %default-locale-definitions
                   (utf8-locales (syntax-rules ()
                                   ((_ name ...)
                                    (list (utf8-locale name) ...)))))
-    ;; Add "en_US.UTF-8" for compatibility with Guix 0.8.
-    (cons (locale-definition
-           (name "en_US.UTF-8")
-           (source "en_US")
-           (charset "UTF-8"))
-          (utf8-locales "ca_ES"
-                        "cs_CZ"
-                        "da_DK"
-                        "de_DE"
-                        "el_GR"
-                        "en_AU"
-                        "en_CA"
-                        "en_GB"
-                        "en_US"
-                        "es_AR"
-                        "es_CL"
-                        "es_ES"
-                        "es_MX"
-                        "fi_FI"
-                        "fr_BE"
-                        "fr_CA"
-                        "fr_CH"
-                        "fr_FR"
-                        "ga_IE"
-                        "it_IT"
-                        "ja_JP"
-                        "ko_KR"
-                        "nb_NO"
-                        "nl_NL"
-                        "pl_PL"
-                        "pt_PT"
-                        "ro_RO"
-                        "ru_RU"
-                        "sv_SE"
-                        "tr_TR"
-                        "uk_UA"
-                        "vi_VN"
-                        "zh_CN"))))
+    ;; The six UN official languages, with at most two variants per language.
+    (utf8-locales "ar_DZ"
+                  "ar_JO"
+                  "en_GB"
+                  "en_US"
+                  "es_AR"
+                  "es_ES"
+                  "fr_CA"
+                  "fr_FR"
+                  "ru_RU"
+                  "zh_CN")))
 
 
 ;;;