fix: translate messages in admin prompts
This commit is contained in:
1 parent
b9c3b324a3
commit
8d11676740
3 files changed
+40
-22
No files matched your search
@@ -7,7 +7,7 @@ msgstr ""
|
|||||||
"Project-Id-Version: plasma-face-unlock 1.0.0\n"
|
"Project-Id-Version: plasma-face-unlock 1.0.0\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/LoonixTools/plasma-face-unlock/"
|
"Report-Msgid-Bugs-To: https://github.com/LoonixTools/plasma-face-unlock/"
|
||||||
"issues\n"
|
"issues\n"
|
||||||
"POT-Creation-Date: 2026-09-24 01:31+0200\n"
|
"POT-Creation-Date: 2026-09-24 10:37+0200\n"
|
||||||
"PO-Revision-Date: 2026-09-23 22:32+0200\n"
|
"PO-Revision-Date: 2026-09-23 22:32+0200\n"
|
||||||
"Last-Translator: Felitendo\n"
|
"Last-Translator: Felitendo\n"
|
||||||
"Language-Team: German\n"
|
"Language-Team: German\n"
|
||||||
@@ -434,11 +434,11 @@ msgstr "alle ausgeschaltet"
|
|||||||
msgid "none found"
|
msgid "none found"
|
||||||
msgstr "keine gefunden"
|
msgstr "keine gefunden"
|
||||||
|
|
||||||
#: src/lib/menu.sh:233 /tmp/tmp.3ElRvSMg8S/settings.sh:12
|
#: src/lib/menu.sh:233 /tmp/tmp.bBbo63fNu2/settings.sh:12
|
||||||
msgid "Camera"
|
msgid "Camera"
|
||||||
msgstr "Kamera"
|
msgstr "Kamera"
|
||||||
|
|
||||||
#: src/lib/menu.sh:235 /tmp/tmp.3ElRvSMg8S/settings.sh:1
|
#: src/lib/menu.sh:235 /tmp/tmp.bBbo63fNu2/settings.sh:1
|
||||||
msgid "Lock screen"
|
msgid "Lock screen"
|
||||||
msgstr "Sperrbildschirm"
|
msgstr "Sperrbildschirm"
|
||||||
|
|
||||||
@@ -446,11 +446,11 @@ msgstr "Sperrbildschirm"
|
|||||||
msgid "sudo"
|
msgid "sudo"
|
||||||
msgstr "sudo"
|
msgstr "sudo"
|
||||||
|
|
||||||
#: src/lib/menu.sh:237 /tmp/tmp.3ElRvSMg8S/settings.sh:7
|
#: src/lib/menu.sh:237 /tmp/tmp.bBbo63fNu2/settings.sh:7
|
||||||
msgid "Admin prompts"
|
msgid "Admin prompts"
|
||||||
msgstr "Admin-Abfragen"
|
msgstr "Admin-Abfragen"
|
||||||
|
|
||||||
#: src/lib/menu.sh:238 /tmp/tmp.3ElRvSMg8S/settings.sh:9
|
#: src/lib/menu.sh:238 /tmp/tmp.bBbo63fNu2/settings.sh:9
|
||||||
msgid "Photo check"
|
msgid "Photo check"
|
||||||
msgstr "Foto-Prüfung"
|
msgstr "Foto-Prüfung"
|
||||||
|
|
||||||
@@ -878,21 +878,21 @@ msgstr "Die Animationen der Bubble einmal abspielen."
|
|||||||
msgid "Bubble style for the demo: full or minimal."
|
msgid "Bubble style for the demo: full or minimal."
|
||||||
msgstr "Bubble-Stil für die Demo: full oder minimal."
|
msgstr "Bubble-Stil für die Demo: full oder minimal."
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:293
|
#: src/pam/pam_plasma_face_unlock.c:311
|
||||||
msgid "Look at the camera to unlock."
|
msgid "Look at the camera to unlock."
|
||||||
msgstr "Schau zum Entsperren in die Kamera."
|
msgstr "Schau zum Entsperren in die Kamera."
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:296
|
#: src/pam/pam_plasma_face_unlock.c:314
|
||||||
msgid "Blink, or turn your head a little."
|
msgid "Blink, or turn your head a little."
|
||||||
msgstr "Blinzle oder dreh den Kopf ein wenig."
|
msgstr "Blinzle oder dreh den Kopf ein wenig."
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:312
|
#: src/pam/pam_plasma_face_unlock.c:330
|
||||||
msgid "Face unlock is paused after too many tries. Use your password."
|
msgid "Face unlock is paused after too many tries. Use your password."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Die Gesichtsentsperrung ist nach zu vielen Versuchen pausiert. Nutze dein "
|
"Die Gesichtsentsperrung ist nach zu vielen Versuchen pausiert. Nutze dein "
|
||||||
"Passwort."
|
"Passwort."
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:316
|
#: src/pam/pam_plasma_face_unlock.c:334
|
||||||
msgid "Face not recognised."
|
msgid "Face not recognised."
|
||||||
msgstr "Gesicht nicht erkannt."
|
msgstr "Gesicht nicht erkannt."
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -5,10 +5,10 @@
|
|||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: plasma-face-unlock 1.0.0\n"
|
"Project-Id-Version: plasma-face-unlock 1.0.1\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/LoonixTools/plasma-face-unlock/"
|
"Report-Msgid-Bugs-To: https://github.com/LoonixTools/plasma-face-unlock/"
|
||||||
"issues\n"
|
"issues\n"
|
||||||
"POT-Creation-Date: 2026-09-24 01:31+0200\n"
|
"POT-Creation-Date: 2026-09-24 10:37+0200\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -417,11 +417,11 @@ msgstr ""
|
|||||||
msgid "none found"
|
msgid "none found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/lib/menu.sh:233 /tmp/tmp.3ElRvSMg8S/settings.sh:12
|
#: src/lib/menu.sh:233 /tmp/tmp.bBbo63fNu2/settings.sh:12
|
||||||
msgid "Camera"
|
msgid "Camera"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/lib/menu.sh:235 /tmp/tmp.3ElRvSMg8S/settings.sh:1
|
#: src/lib/menu.sh:235 /tmp/tmp.bBbo63fNu2/settings.sh:1
|
||||||
msgid "Lock screen"
|
msgid "Lock screen"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -429,11 +429,11 @@ msgstr ""
|
|||||||
msgid "sudo"
|
msgid "sudo"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/lib/menu.sh:237 /tmp/tmp.3ElRvSMg8S/settings.sh:7
|
#: src/lib/menu.sh:237 /tmp/tmp.bBbo63fNu2/settings.sh:7
|
||||||
msgid "Admin prompts"
|
msgid "Admin prompts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/lib/menu.sh:238 /tmp/tmp.3ElRvSMg8S/settings.sh:9
|
#: src/lib/menu.sh:238 /tmp/tmp.bBbo63fNu2/settings.sh:9
|
||||||
msgid "Photo check"
|
msgid "Photo check"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@@ -826,19 +826,19 @@ msgstr ""
|
|||||||
msgid "Bubble style for the demo: full or minimal."
|
msgid "Bubble style for the demo: full or minimal."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:293
|
#: src/pam/pam_plasma_face_unlock.c:311
|
||||||
msgid "Look at the camera to unlock."
|
msgid "Look at the camera to unlock."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:296
|
#: src/pam/pam_plasma_face_unlock.c:314
|
||||||
msgid "Blink, or turn your head a little."
|
msgid "Blink, or turn your head a little."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:312
|
#: src/pam/pam_plasma_face_unlock.c:330
|
||||||
msgid "Face unlock is paused after too many tries. Use your password."
|
msgid "Face unlock is paused after too many tries. Use your password."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pam/pam_plasma_face_unlock.c:316
|
#: src/pam/pam_plasma_face_unlock.c:334
|
||||||
msgid "Face not recognised."
|
msgid "Face not recognised."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
#include <locale.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -49,7 +50,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DOMAIN PFU_NAME
|
#define DOMAIN PFU_NAME
|
||||||
#define _(s) dgettext(DOMAIN, s)
|
// Marks a message for translation. say() translates it.
|
||||||
|
#define _(s) (s)
|
||||||
|
|
||||||
struct options {
|
struct options {
|
||||||
const char *socket;
|
const char *socket;
|
||||||
@@ -200,10 +202,26 @@ static bool json_true(const char *line, const char *key)
|
|||||||
return strstr(line, pattern) != NULL;
|
return strstr(line, pattern) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Admin prompts run this in polkit's helper. It keeps LANG but never calls
|
||||||
|
// setlocale, so gettext would stay in English. Take the language from the
|
||||||
|
// environment for this thread while the message goes out.
|
||||||
static void say(pam_handle_t *pamh, int flags, const char *message)
|
static void say(pam_handle_t *pamh, int flags, const char *message)
|
||||||
{
|
{
|
||||||
if (!(flags & PAM_SILENT)) {
|
if (flags & PAM_SILENT) {
|
||||||
pam_info(pamh, "%s", message);
|
return;
|
||||||
|
}
|
||||||
|
locale_t loc = (locale_t)0, old = (locale_t)0;
|
||||||
|
const char *global = setlocale(LC_MESSAGES, NULL);
|
||||||
|
if (!global || strcmp(global, "C") == 0 || strcmp(global, "POSIX") == 0) {
|
||||||
|
loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0);
|
||||||
|
if (loc) {
|
||||||
|
old = uselocale(loc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pam_info(pamh, "%s", dgettext(DOMAIN, message));
|
||||||
|
if (loc) {
|
||||||
|
uselocale(old);
|
||||||
|
freelocale(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user