From 5e56a2bfe8bd2cc8865e96cb86634d1b2517a559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Thu, 9 Jan 2025 22:47:58 +0800 Subject: [PATCH] Update install.sh --- bin/install.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/bin/install.sh b/bin/install.sh index 6aa97ed..6f89a78 100644 --- a/bin/install.sh +++ b/bin/install.sh @@ -46,12 +46,28 @@ case $lang_choice in echo "无效的选项,将使用默认系统语言环境: $DEFAULT_LANG" ;; esac + +# 设置语言环境 export LANG=$DEFAULT_LANG export LC_ALL=$DEFAULT_LANG -echo "$DEFAULT_LANG UTF-8" >> /etc/locale.gen -dpkg-reconfigure --frontend=noninteractive locales + +# 添加到 locale.gen 如果不存在 +if ! grep -q "^$DEFAULT_LANG UTF-8" /etc/locale.gen; then + echo "$DEFAULT_LANG UTF-8" >> /etc/locale.gen +fi + +# 生成 locale locale-gen +# 重新配置 locales +dpkg-reconfigure --frontend=noninteractive locales + +# 如果需要调试输出 +if [ "$DEBUG" = true ]; then + echo "Language set to: $DEFAULT_LANG" + echo "Using CN mirror: $USE_CN_MIRROR" +fi + # Debian版本相关命令 DEBIAN_VERSION=$(cat /etc/debian_version)