lightdm/1001-fix-translator-fixed-the-issue-that-lightdm-s-PAM-me.patch
liuxinhao 49fcb733f9 Fixed the problem that the PAM message returned by lightdm was not translated
Signed-off-by: kylinsecos <gitee@kylinos.com.cn>
2022-01-25 17:37:57 +08:00

43 lines
1.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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