I have made an attempt to fix this. Please see the attached patch.
--
Gunnar Hjalmarsson
https://launchpad.net/~gunnarhj
>From 63726d9f16de39b94d5bfe85ae5474ab86d77972 Mon Sep 17 00:00:00 2001
From: Gunnar Hjalmarsson
Date: Wed, 21 Feb 2018 21:23:20 +0100
Subject: [PATCH] Enable translations for the cryptroot script
https://bugs.debian.org/688735, https://launchpad.net/bugs/1027854
---
.../{cryptroot-script => cryptroot-script.sh} | 35 +++---
debian/patches/cryptroot-script-translations.patch | 13
debian/patches/series | 1 +
debian/rules | 4 ++-
4 files changed, 41 insertions(+), 12 deletions(-)
rename debian/initramfs/{cryptroot-script => cryptroot-script.sh} (84%)
create mode 100644 debian/patches/cryptroot-script-translations.patch
diff --git a/debian/initramfs/cryptroot-script b/debian/initramfs/cryptroot-script.sh
similarity index 84%
rename from debian/initramfs/cryptroot-script
rename to debian/initramfs/cryptroot-script.sh
index 75299a0..3fa9e67 100644
--- a/debian/initramfs/cryptroot-script
+++ b/debian/initramfs/cryptroot-script.sh
@@ -1,6 +1,8 @@
#!/bin/sh
PREREQ="cryptroot-prepare"
+export TEXTDOMAIN=cryptsetup
+. /usr/bin/gettext.sh
#
# Standard initramfs preamble
@@ -165,7 +167,8 @@ parse_options()
export CRYPTTAB_OPTIONS
if [ -z "$cryptsource" ]; then
- message "cryptsetup ($crypttarget): source parameter missing"
+ # TRANSLATORS: Keep the variable $crypttarget untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): source parameter missing')
return 1
fi
return 0
@@ -175,7 +178,8 @@ activate_vg()
{
# Sanity checks
if [ ! -x /sbin/lvm ]; then
- message "cryptsetup ($crypttarget): lvm is not available"
+ # TRANSLATORS: Keep the variable $crypttarget untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): lvm is not available')
return 1
fi
@@ -206,7 +210,8 @@ setup_mapping()
cryptkeyscript="/lib/cryptsetup/askpass"
cryptkey="Please unlock disk $diskname: "
elif ! type "$cryptkeyscript" >/dev/null; then
- message "cryptsetup ($crypttarget): error - script \"$cryptkeyscript\" missing"
+ # TRANSLATORS: Keep the variables $crypttarget and $cryptkeyscript untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): error - script "$cryptkeyscript" missing')
return 1
fi
@@ -218,7 +223,8 @@ setup_mapping()
fi
if [ -n "$cryptheader" ] && ! type "$cryptheader" >/dev/null; then
- message "cryptsetup ($crypttarget): error - LUKS header \"$cryptheader\" missing"
+ # TRANSLATORS: Keep the variables $crypttarget and $cryptheader untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): error - LUKS header "$cryptheader" missing')
return 1
fi
@@ -323,13 +329,15 @@ setup_mapping()
if [ ! -e "$NEWROOT" ]; then
if ! crypttarget="$crypttarget" cryptsource="$cryptsource" \
$cryptkeyscript "$cryptkey" | $cryptopen; then
-message "cryptsetup ($crypttarget): cryptsetup failed, bad password or options?"
+# TRANSLATORS: Keep the variable $crypttarget untranslated
+message $(eval_gettext 'cryptsetup ($crypttarget): cryptsetup failed, bad password or options?')
continue
fi
fi
if [ ! -e "$NEWROOT" ]; then
- message "cryptsetup ($crypttarget): unknown error setting up device mapping"
+ # TRANSLATORS: Keep the variable $crypttarget untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): unknown error setting up device mapping')
return 1
fi
@@ -341,7 +349,8 @@ setup_mapping()
#if [ "$FSTYPE" = "lvm" ] || [ "$FSTYPE" = "lvm2" ]; then
if [ "$FSTYPE" = "LVM_member" ] || [ "$FSTYPE" = "LVM2_member" ]; then
if [ -z "$cryptlvm" ]; then
-message "cryptsetup ($crypttarget): lvm fs found but no lvm configured"
+# TRANSLATORS: Keep the variable $crypttarget untranslated
+message $(eval_gettext 'cryptsetup ($crypttarget): lvm fs found but no lvm configured')
return 1
elif ! activate_vg; then
# disable error message, LP: #151532
@@ -366,7 +375,8 @@ setup_mapping()
#if [ -z "$FSTYPE" ] || [ "$FSTYPE" = "unknown" ]; then
if [ -z "$FSTYPE" ]; then
- message "cryptsetup ($crypttarget): unknown fstype, bad password or options?"
+ # TRANSLATORS: Keep the variable $crypttarget untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): unknown fstype, bad password or options?')
udev_settle
$cryptremove
continue
@@ -375,15 +385,18 @@ setup_mapping()
# decrease $count by 1, apparently last try was successful.
count=$(( $count - 1 ))
- message "cryptsetup ($crypttarget): set up successfully"
+ # TRANSLATORS: Keep the variable $crypttarget untranslated
+ message $(eval_gettext 'cryptsetup ($crypttarget): set up successfully')
break
done
failsleep=60 # make configurable later?
if [ "$cryptrootdev" = "yes" ] && [ $crypttries -gt 0 ] && [ $count -ge