From 364c3060d2961ae2e5b9ecb6c49f698d59c2b71b Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Fri, 6 Jan 2023 16:23:32 +0800
Subject: [PATCH] fix greeter translation

---
 ukui-greeter/greeter/greeterwindow.cpp | 6 +++---
 ukui-greeter/greeter/loginwindow.cpp   | 2 +-
 ukui-greeter/ukui-greeter.pro          | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ukui-greeter/greeter/greeterwindow.cpp b/ukui-greeter/greeter/greeterwindow.cpp
index 39b192f..2fefa9f 100644
--- a/ukui-greeter/greeter/greeterwindow.cpp
+++ b/ukui-greeter/greeter/greeterwindow.cpp
@@ -783,9 +783,9 @@ void GreeterWindow::updateLanguage(QString userName)
             qWarning() << "Get User's language error" << languageReply.error();
         else {
             language = languageReply.value().variant().toString();
-            if(!language.isEmpty()){
-                    onLanguageChanged(language);
-             }
+	    if(language.isEmpty())
+	        language = QLocale::system().name();
+	    onLanguageChanged(language);
         }
 
         QDBusReply<QDBusVariant> fomatsLocalReply = userIface.call("Get", "org.freedesktop.Accounts.User", "FormatsLocale");
diff --git a/ukui-greeter/greeter/loginwindow.cpp b/ukui-greeter/greeter/loginwindow.cpp
index 5c40442..616b081 100644
--- a/ukui-greeter/greeter/loginwindow.cpp
+++ b/ukui-greeter/greeter/loginwindow.cpp
@@ -708,7 +708,7 @@ void LoginWindow::onShowPrompt(QString text, QLightDM::Greeter::PromptType type)
         if (!m_deviceInfo) {
             switchLoginOptType(LOGINOPT_TYPE_PASSWORD);
         }
-        if(text == "Password: "||text == "密码："){
+        if(text == "Password: "||text == "密码： "){
             text = tr("Password: ");
             m_isPassWdInput = true;
         }
diff --git a/ukui-greeter/ukui-greeter.pro b/ukui-greeter/ukui-greeter.pro
index b6c8814..fc12b32 100644
--- a/ukui-greeter/ukui-greeter.pro
+++ b/ukui-greeter/ukui-greeter.pro
@@ -101,7 +101,7 @@ TRANSLATIONS += translations/zh_CN.ts \
                 translations/tr.ts \
                 translations/es.ts
 
-system("lrelease translations/*.ts")
+system("lrelease-qt5 translations/*.ts")
 
 qm_file.files = translations/*.qm
 qm_file.path = $${PREFIX}/translations/
-- 
2.33.0

