From 09c045a368c3ab8e173f6ebac393e5247c35ec85 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Sun, 30 Nov 2025 23:15:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=BA=E5=88=B6=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=A8=A1=E6=9D=BF=E4=BD=9C=E4=B8=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 备份原英文模板到 templates-en-backup - 将中文模板覆盖到默认 templates 目录 - 创建 templates-zh 符号链接兼容不同浏览器 - 确保无论浏览器语言设置如何都显示中文 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- setup_cups.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup_cups.sh b/setup_cups.sh index 99f1e81..9b266f3 100755 --- a/setup_cups.sh +++ b/setup_cups.sh @@ -738,8 +738,20 @@ install_chinese_templates() { success "中文界面模板安装完成(已下载 $success_count/$total 个文件)" else warn "中文模板下载失败,界面将显示英文" + return 1 fi fi + + # 创建语言目录链接(兼容不同浏览器语言设置) + ln -sf "$templates_dir" /usr/share/cups/templates-zh 2>/dev/null || true + + # 备份原英文模板并用中文覆盖默认模板(确保显示中文) + if [ -d /usr/share/cups/templates ] && [ ! -d /usr/share/cups/templates-en-backup ]; then + cp -r /usr/share/cups/templates /usr/share/cups/templates-en-backup + info "已备份原英文模板到 templates-en-backup" + fi + cp -f "$templates_dir"/*.tmpl /usr/share/cups/templates/ + success "中文模板已设为默认" } # 安装虚拟PDF打印机(用于测试连接)