43 lines
1.3 KiB
Diff
43 lines
1.3 KiB
Diff
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
|
||
|