Fix terminal garbled characters when not root user change locale language
This commit is contained in:
parent
14a292eb90
commit
357eaa84af
@ -0,0 +1,60 @@
|
|||||||
|
From c7f9c64e1c920ed00f434a4acc9e687a9070208b Mon Sep 17 00:00:00 2001
|
||||||
|
From: tanyulong2021 <tanyulong@kylinos.cn>
|
||||||
|
Date: Fri, 17 Mar 2023 09:50:56 +0800
|
||||||
|
Subject: [PATCH] Fix terminal garbled characters when not root user change
|
||||||
|
locale language
|
||||||
|
|
||||||
|
---
|
||||||
|
plugins/time-language/area/area.cpp | 10 ++++++----
|
||||||
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/plugins/time-language/area/area.cpp b/plugins/time-language/area/area.cpp
|
||||||
|
index df6834d..58704ec 100644
|
||||||
|
--- a/plugins/time-language/area/area.cpp
|
||||||
|
+++ b/plugins/time-language/area/area.cpp
|
||||||
|
@@ -184,7 +184,7 @@ void Area::initLanguage()
|
||||||
|
|
||||||
|
QStringList res = getUserDefaultLanguage();
|
||||||
|
QString lang = res.at(1);
|
||||||
|
- int langIndex = lang.split(':').at(0) == "zh_CN" ? 0 : 1;
|
||||||
|
+ int langIndex = lang.split(':').at(0) == "zh_CN.UTF-8" ? 0 : 1;
|
||||||
|
|
||||||
|
if (0 == langIndex) {
|
||||||
|
chineseFrame->showSelectedIcon(true);
|
||||||
|
@@ -201,13 +201,13 @@ void Area::initLanguage()
|
||||||
|
|
||||||
|
connect(chineseFrame, &LanguageFrame::clicked, this, [=](){
|
||||||
|
englishFrame->showSelectedIcon(false);
|
||||||
|
- m_areaInterface->call("SetLanguage","zh_CN");
|
||||||
|
+ m_areaInterface->call("SetLanguage","zh_CN.UTF-8");
|
||||||
|
showMessageBox(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(englishFrame, &LanguageFrame::clicked, this, [=](){
|
||||||
|
chineseFrame->showSelectedIcon(false);
|
||||||
|
- m_areaInterface->call("SetLanguage","en_US");
|
||||||
|
+ m_areaInterface->call("SetLanguage","en_US.UTF-8");
|
||||||
|
showMessageBox(2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@@ -218,7 +218,7 @@ void Area::initComponent() {
|
||||||
|
|
||||||
|
QStringList res = getUserDefaultLanguage();
|
||||||
|
QString lang = res.at(1);
|
||||||
|
- int langIndex = lang.split(':').at(0) == "zh_CN" ? 1 : 0;
|
||||||
|
+ int langIndex = lang.split(':').at(0) == "zh_CN.UTF-8" ? 1 : 0;
|
||||||
|
int formatIndex = res.at(0) == "zh_CN.UTF-8" ? 1 : 0;
|
||||||
|
// ui->langcomboBox->setCurrentIndex(langIndex);
|
||||||
|
ui->countrycomboBox->setCurrentIndex(formatIndex);
|
||||||
|
@@ -344,6 +344,8 @@ QStringList Area::getUserDefaultLanguage() {
|
||||||
|
}
|
||||||
|
if(language.isEmpty() && propertyMap.keys().contains("Language")) {
|
||||||
|
language = propertyMap.find("Language").value().toString();
|
||||||
|
+ if(language.isEmpty())
|
||||||
|
+ language = QLocale::system().name()+ ".UTF-8";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qDebug() << "reply failed";
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: ukui-control-center
|
Name: ukui-control-center
|
||||||
Version: 3.1.2
|
Version: 3.1.2
|
||||||
Release: 12
|
Release: 13
|
||||||
Summary: utilities to configure the UKUI desktop
|
Summary: utilities to configure the UKUI desktop
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
URL: http://www.ukui.org
|
URL: http://www.ukui.org
|
||||||
@ -14,6 +14,7 @@ Patch08: ukui-control-center-3.0.4-fix-invalid-automatic-login.patch
|
|||||||
Patch10: 0010-Fix-the-problem-of-scrambled-shortcut-keys.patch
|
Patch10: 0010-Fix-the-problem-of-scrambled-shortcut-keys.patch
|
||||||
Patch11: 0011-Fix-about-copyright-display-error.patch
|
Patch11: 0011-Fix-about-copyright-display-error.patch
|
||||||
Patch12: 0012-fix-add-group-failed-issue.patch
|
Patch12: 0012-fix-add-group-failed-issue.patch
|
||||||
|
Patch13: 0013-Fix-terminal-garbled-characters-when-not-root-user-change-locale-language.patch
|
||||||
|
|
||||||
BuildRequires: qt5-qtsvg-devel
|
BuildRequires: qt5-qtsvg-devel
|
||||||
BuildRequires: gsettings-qt-devel
|
BuildRequires: gsettings-qt-devel
|
||||||
@ -139,6 +140,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 17 2023 tanyulong <tanyulong@kylinos.cn> - 3.1.2-13
|
||||||
|
- Fix terminal garbled characters when not root user change locale language
|
||||||
|
|
||||||
* Wed Mar 01 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-12
|
* Wed Mar 01 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-12
|
||||||
- add build debuginfo and debugsource
|
- add build debuginfo and debugsource
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user