Merge #180368: nixos/i18n: normalise locale names

This commit is contained in:
Vladimír Čunát 2022-07-16 09:01:42 +02:00
commit 7fbdf335d8
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -53,16 +53,16 @@ with lib;
supportedLocales = mkOption {
type = types.listOf types.str;
default = builtins.map (l: l + "/UTF-8")
(unique (
default = unique
(builtins.map (l: (replaceStrings [ "utf8" "utf-8" "UTF8" ] [ "UTF-8" "UTF-8" "UTF-8" ] l) + "/UTF-8") (
[
"C.UTF-8"
config.i18n.defaultLocale
] ++ (attrValues (filterAttrs (n: v: n != "LANGUAGE") config.i18n.extraLocaleSettings))
));
defaultText = literalExpression ''
builtins.map (l: l + "/UTF-8")
(unique (
unique
(builtins.map (l: (replaceStrings [ "utf8" "utf-8" "UTF8" ] [ "UTF-8" "UTF-8" "UTF-8" ] l) + "/UTF-8") (
[
"C.UTF-8"
config.i18n.defaultLocale