From 79215ca29e587fe46b194db39c97a445e291ce38 Mon Sep 17 00:00:00 2001 From: Akad <134841282+Hexalantes@users.noreply.github.com> Date: Tue, 1 Sep 2026 09:57:42 +0300 Subject: [PATCH 1/3] Enhance locale setup with additional variables Add locale variables for GUI applications and improve error handling. --- sysding | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/sysding b/sysding index ce7ba35..bff9004 100644 --- a/sysding +++ b/sysding @@ -336,21 +336,35 @@ setup_locale() { # set up zones default locale typeset def_locale typeset rt - + typeset lc_base + typeset lc_lang + typeset lc_language def_locale="$1" rt=0 - if ! locale -a | egrep "^${def_locale}$$" 2>&1 >/dev/null ; then + if ! locale -a | egrep "^${def_locale}\$" >/dev/null 2>&1 ; then # selected locale is not installed - fall back to C and log error - log_error "specified locale ${def_locale} not installed, reverting to C" - def_local="C" - rt=42 - fi - + log_error "specified locale ${def_locale} not installed, reverting to C" + def_locale="C" + rt=42 + fi printf ",g,^LANG=,d\na\nLANG=%s\n.\nw\nq\n" "${def_locale}" | ed /etc/default/init - REBOOT_NEEDED=yes + # set locale variables for gui apps if it's not fallback + if [ "${def_locale}" != "C" ]; then + lc_base="${def_locale%%.*}" + lc_lang="${lc_base%%_*}" + if [ "${lc_lang}" = "en" ]; then + lc_language="${lc_base}:en" + else + lc_language="${lc_base}:${lc_lang}:en" + fi + + printf "export LANG=%s\nexport LC_TIME=\$LANG\nexport LC_MESSAGES=\$LANG\nexport LANGUAGE=%s\n" \ + "${def_locale}" "${lc_language}" >> /etc/profile + fi + REBOOT_NEEDED=yes return ${rt} } From 6bcec703aa1638cffd7bdb57ddae3950ca1ed154 Mon Sep 17 00:00:00 2001 From: Akad <134841282+Hexalantes@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:27:43 +0300 Subject: [PATCH 2/3] Remove LC_* variables --- sysding | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysding b/sysding index bff9004..365ac78 100644 --- a/sysding +++ b/sysding @@ -360,7 +360,7 @@ setup_locale() { lc_language="${lc_base}:${lc_lang}:en" fi - printf "export LANG=%s\nexport LC_TIME=\$LANG\nexport LC_MESSAGES=\$LANG\nexport LANGUAGE=%s\n" \ + printf "export LANGUAGE=%s\n" \ "${def_locale}" "${lc_language}" >> /etc/profile fi From 78459d6f808590c3c1ff23c1687e5e358dc34536 Mon Sep 17 00:00:00 2001 From: Akad <134841282+Hexalantes@users.noreply.github.com> Date: Thu, 10 Sep 2026 17:17:47 +0300 Subject: [PATCH 3/3] Use /etc/profile.d instead of /etc/profile --- sysding | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sysding b/sysding index 365ac78..bc1033a 100644 --- a/sysding +++ b/sysding @@ -359,9 +359,11 @@ setup_locale() { else lc_language="${lc_base}:${lc_lang}:en" fi - + mdkir -p /etc/profile.d + touch /etc/profile.d/language.sh + chmod +x /etc/profile.d/language.sh printf "export LANGUAGE=%s\n" \ - "${def_locale}" "${lc_language}" >> /etc/profile + "${def_locale}" "${lc_language}" >> /etc/profile.d/language.sh fi REBOOT_NEEDED=yes