44 lines
1.8 KiB
Diff
44 lines
1.8 KiB
Diff
From 5f3829a86969a79769dcf44c1918789d93c9b684 Mon Sep 17 00:00:00 2001
|
||
From: tanyulong2021 <tanyulong@kylinos.cn>
|
||
Date: Wed, 29 Jun 2022 16:27:49 +0800
|
||
Subject: [PATCH] add Support Tibetan translation
|
||
|
||
---
|
||
debian/ukui-system-monitor.install | 3 +++
|
||
src/main.cpp | 7 ++++++-
|
||
2 files changed, 9 insertions(+), 1 deletion(-)
|
||
create mode 100644 debian/ukui-system-monitor.install
|
||
|
||
diff --git a/debian/ukui-system-monitor.install b/debian/ukui-system-monitor.install
|
||
new file mode 100644
|
||
index 0000000..788e6fa
|
||
--- /dev/null
|
||
+++ b/debian/ukui-system-monitor.install
|
||
@@ -0,0 +1,3 @@
|
||
+data/kylin-system-monitor /usr/share/kylin-user-guide/data/guide
|
||
+data/png /usr/share/icons/hicolor/
|
||
+src/translation/*.qm /usr/share/ukui-system-monitor/translations/
|
||
diff --git a/src/main.cpp b/src/main.cpp
|
||
index f65b25a..b9b2613 100755
|
||
--- a/src/main.cpp
|
||
+++ b/src/main.cpp
|
||
@@ -69,9 +69,14 @@ int main(int argc, char *argv[])
|
||
|
||
QString locale = QLocale::system().name();
|
||
QTranslator translator;
|
||
- if(locale == "zh_CN" || locale == "es" || locale == "fr" || locale == "de" || locale == "ru") {//中文 西班牙语 法语 德语 俄语
|
||
+ if(locale == "zh_CN" || locale == "es" || locale == "fr" || locale == "de" || locale == "ru" || locale == "en_US" || locale == "bo_CN") {//中文 西班牙语 法语 德语 俄语
|
||
+ #if 0
|
||
if(!translator.load("ukui-system-monitor_" + locale + ".qm",
|
||
":/translation/"))
|
||
+ #else
|
||
+ if(!translator.load("ukui-system-monitor_" + locale + ".qm",
|
||
+ "/usr/share/ukui-system-monitor/translations/"))
|
||
+ #endif
|
||
qDebug() << "Load translation file:"<< "ukui-system-monitor_" + locale + ".qm" << " failed!";
|
||
else
|
||
app.installTranslator(&translator);
|
||
--
|
||
2.33.0
|
||
|