Fixed the problem that the PAM message returned by lightdm was not translated

Signed-off-by: kylinsecos <gitee@kylinos.com.cn>
This commit is contained in:
liuxinhao 2022-01-25 16:22:37 +08:00 committed by kylinsecos
parent b9b7bc382e
commit 49fcb733f9
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 817fea974287bdea8686ced43f708531148d98bc Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinos.com.cn>
Date: Tue, 25 Jan 2022 15:41:57 +0800
Subject: [PATCH] fix(translator): fixed the issue that lightdm's PAM messages
were not translated
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复lightdm返回的PAM消息未经过翻译并将翻译指定为UTF-8编码避免lightdm-qt5接口之中乱码问题
Signed-off-by: liuxinhao <liuxinhao@kylinos.com.cn>
---
src/lightdm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lightdm.c b/src/lightdm.c
index 81b9117..2df2f9f 100644
--- a/src/lightdm.c
+++ b/src/lightdm.c
@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
+#include <locale.h>
#include "configuration.h"
#include "display-manager.h"
@@ -551,6 +552,10 @@ main (int argc, char **argv)
sigaction (SIGPIPE, &action, NULL);
sigaction (SIGHUP, &action, NULL);
+ setlocale(LC_CTYPE,"");
+ setlocale(LC_MESSAGES,"");
+ bind_textdomain_codeset("Linux-PAM", "UTF-8");
+
/* When lightdm starts sessions it needs to run itself in a new mode */
if (argc >= 2 && strcmp (argv[1], "--session-child") == 0)
return session_child_run (argc, argv);
--
2.18.1

View File

@ -7,7 +7,7 @@
Name: lightdm
Summary: A cross-desktop Display Manager
Version: 1.30.0
Release: 11
Release: 12
# library/bindings are LGPLv2 or LGPLv3, the rest GPLv3+
License: (LGPLv2 or LGPLv3) and GPLv3+
@ -42,6 +42,9 @@ Patch0: lightdm-1.25.1-disable_dmrc.patch
Patch9001: 9001-multi-pipe-mode.patch
Patch9002: 9002-dm-tool-lock-function-patch.patch
# kylin
Patch1001: 1001-fix-translator-fixed-the-issue-that-lightdm-s-PAM-me.patch
BuildRequires: gettext
BuildRequires: gnome-common
BuildRequires: gtk-doc itstool
@ -311,6 +314,9 @@ fi
%changelog
* Tue Jan 25 2022 liuxinhao <liuxinhao@kylinos.com.cn> - 1.30.0-12
- Fixed the problem that the PAM message returned by lightdm was not translated
* Mon Sep 13 2021 zhaoshuang <zhaoshuang@uniontech.com> - 1.30.0-11
- Add a uniontech patch to fix dm-tool