Skip to contentSkip to conversation

cryptsetup 1.5.0-rc2 messages questions

dm-crypt Applied Petr Pisar 2 participants 5 messages Jun 25, 2012 – Jun 26, 2012

lore
Share & tools
lore

Petr Pisar

author
#0 lore raw

Hello,

while updating Czech translation for cryptsetup 1.5.0-rc2, I found few issues I'd like to clarify.

(1) Message:

#: src/cryptsetup_reencrypt.c:1249
msgid "[OPTION...] <device>"

is not properly internationalized:

    poptSetOtherOptionHelp(popt_context, N_("[OPTION...] <device>"));

As a result, the usage syntax is not fully localized:

$ ./src/cryptsetup-reencrypt --help
crypt_reencrypt 1.5.0-rc2
Použití: cryptsetup-reencrypt [OPTION...] <device>
      --version                        Vypíše verzi balíku

This is because there should be _()' instead of N_()'.

(2) It think message

#: src/cryptsetup_reencrypt.c:451
#, c-format
msgid "Log file %s exists, restarting reencryption.\n"

should be rephrased to resuming reencryption' if I understand the reencryption log correctly. Restarting' means drop everything what has been done till now and start again from the begining.

(3) There is missing space after the number 1.
#: src/cryptsetup_reencrypt.c:1288
msgid "Only values between 1MiB and 64 MiB allowed for reencryption block size."

-- Petr

#1 lore raw
Quoted 2 lines · Petr Pisar

while updating Czech translation for cryptsetup 1.5.0-rc2, I found few issues I'd like to clarify.

There will be more cleanups needed, I added that to rc2 because this reencryption tool can be useful for several people but it is still experimental.

Let me know if there are other changes needed. (I guess ping on IRC works better in this case ;-)

Quoted 1 line
    poptSetOtherOptionHelp(popt_context, N_("[OPTION...] <device>"));

Hm. Then same problem is then in cryptsetup for years:

N_("[OPTION...] <action> <action-specific>"));

Quoted 9 lines

(2) It think message

#: src/cryptsetup_reencrypt.c:451
#, c-format
msgid "Log file %s exists, restarting reencryption.\n"

should be rephrased to resuming reencryption' if I understand the reencryption log correctly. Restarting' means drop everything what has been done till now and start again from the begining.

yes, I am using "suspending reencryption" elsewhere so resuming is definitely better.

Quoted 3 lines

(3) There is missing space after the number 1.
#: src/cryptsetup_reencrypt.c:1288
msgid "Only values between 1MiB and 64 MiB allowed for reencryption block size."

ok, I'll change that.

Thanks,
Milan

author
#2 lore raw
Quoted 8 lines · Milan Broz
Quoted 1 line · Petr Pisar
    poptSetOtherOptionHelp(popt_context, N_("[OPTION...] <device>"));

Hm. Then same problem is then in cryptsetup for years:

N_("[OPTION...] <action> <action-specific>"));

Yes. I checked popt sources, and obviously, application is reponsible for translating the text. Following patch fixes it in all three main programs.

-- Petr

#3 lore raw

PATCH 1/1 Pass help text to popt already translated

popt does not process the text registered by poptSetOtherOptionHelp() through gettext on its own. Application must do it.

---
 src/cryptsetup.c           |    2 +-
 src/cryptsetup_reencrypt.c |    2 +-
 src/veritysetup.c          |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
src/cryptsetup.c +1 -1
index 09d7510..1ca3287 100644
@@ -1326,7 +1326,7 @@ int main(int argc, const char **argv)
 
 	popt_context = poptGetContext(PACKAGE, argc, argv, popt_options, 0);
 	poptSetOtherOptionHelp(popt_context,
-	                       N_("[OPTION...] <action> <action-specific>"));
+	                       _("[OPTION...] <action> <action-specific>"));
 
 	while((r = poptGetNextOpt(popt_context)) > 0) {
 		unsigned long long ull_value;
src/cryptsetup_reencrypt.c +1 -1
index a7b4509..7c0b985 100644
@@ -1260,7 +1260,7 @@ int main(int argc, const char **argv)
 
 	popt_context = poptGetContext(PACKAGE, argc, argv, popt_options, 0);
 	poptSetOtherOptionHelp(popt_context,
-	                       N_("[OPTION...] <device>"));
+	                       _("[OPTION...] <device>"));
 
 	while((r = poptGetNextOpt(popt_context)) > 0) ;
 	if (r < -1)
src/veritysetup.c +1 -1
index 04691ba..d9bc048 100644
@@ -517,7 +517,7 @@ int main(int argc, const char **argv)
 
 	popt_context = poptGetContext("verity", argc, argv, popt_options, 0);
 	poptSetOtherOptionHelp(popt_context,
-	                       N_("[OPTION...] <action> <action-specific>"));
+	                       _("[OPTION...] <action> <action-specific>"));
 
 	while((r = poptGetNextOpt(popt_context)) > 0) {
 		unsigned long long ull_value;
Signature · 1 line
1.7.3.4
Applied
#4 lore raw

Re: [dm-crypt] [PATCH] Pass help text to popt already translated

Quoted 2 lines · Petr Písař

popt does not process the text registered by poptSetOtherOptionHelp() through gettext on its own. Application must do it.

Applied, thanks.

Milan