From df33c312406b378cc8f9e3fbe0a1f7898a0844d0 Mon Sep 17 00:00:00 2001 From: Oleg Solovyov Date: Tue, 15 Mar 2022 16:00:53 +0300 Subject: Read system-wide locales Signed-off-by: Oleg Solovyov Signed-off-by: Alexey Gladkov --- features/locales/guess/common | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/features/locales/guess/common b/features/locales/guess/common index dc06a0b92..15fdd065c 100755 --- a/features/locales/guess/common +++ b/features/locales/guess/common @@ -2,7 +2,19 @@ . guess-functions -[ -n "${LOCALES-}" ] || - exit 0 +if [ -z "${LOCALES-}" ]; then + is_active_feature "plymouth" || + exit 0 -guess_feature locales + for f in /etc/sysconfig/i18n /etc/locale.conf; do + if [ -s "$f" ] && . "$f"; then + break + fi + done + + LANG="${LANG:-C}" + LOCALES="${LANG%%.*}" +fi + +guess_feature "locales" +guess_variable "LOCALES" "${LOCALES}" -- 2.33.0