From 334d54aaf352800fc5a9b771f0a046a8b4b1ad69 Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 Date: Tue, 17 Jan 2023 12:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9E=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- language.cpp | 6 +++--- locale | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 locale diff --git a/language.cpp b/language.cpp index 476667d..b1b892b 100644 --- a/language.cpp +++ b/language.cpp @@ -22,9 +22,9 @@ int main(){ system("apt install -y language-pack-zh-hans"); system("locale-gen zh_CN.UTF-8"); system("mv /etc/default/locale /etc/default/locale.backup"); - system("touch /etc/default/locale"); - system("echo LANG=\"zh_CN.UTF-8\" > /etc/default/locale"); - system("echo LANGUAGE=\"zh_CN:zh\" > /etc/default/locale"); + system("wget https://raw.githubusercontent.com/TheWhiteDog9487/ubuntu-language-onekey-zh_cn/main/locale"); + system("mv locale /etc/default/locale"); + system("chmod 644 /etc/default/locale"); cout << "原/etc/default/locale已经备份为/etc/default/locale.backup" << endl; cout << "即将重启以应用语言设置,请保存您未完成的工作以防数据丢失" << endl; cout << "输入y或者yes重启或者按Ctrl+C终止本程序" << endl; diff --git a/locale b/locale new file mode 100644 index 0000000..c4e344d --- /dev/null +++ b/locale @@ -0,0 +1,12 @@ +LANG="zh_CN.UTF-8" +LANGUAGE="zh_CN:zh:en_US:en" +LC_NUMERIC="zh_CN.UTF-8" +LC_TIME="zh_CN.UTF-8" +LC_MONETARY="zh_CN.UTF-8" +LC_PAPER="zh_CN.UTF-8" +LC_IDENTIFICATION="zh_CN.UTF-8" +LC_NAME="zh_CN.UTF-8" +LC_ADDRESS="zh_CN.UTF-8" +LC_TELEPHONE="zh_CN.UTF-8" +LC_MEASUREMENT="zh_CN.UTF-8" +LC_ALL=zh_CN.UTF-8 \ No newline at end of file