Skip to contentSkip to conversation

please attempt to minimize string changes

DISCUSSION Vladimir 'φ-coder/phcoder' Serbinenko 3 participants 9 messages Dec 21, 2013 – Dec 22, 2013 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 12 lines · Benno Schulenberg

Hi,

Quoted 4 lines · On Sat, Dec 21, 2013, at 23:12, [email protected] wrote:

You are not allowed to post to this mailing list, and your message has been automatically rejected. If you think that your messages are being rejected in error, contact the mailing list owner at [email protected].

Ehm, msgid bugs are supposed to be reported to this list, so please let the post pass.

Hello, currently bug-grub is subscriber-only list. I'll think of how to change this. Probably it will be changed to moderated or the mail for msgid bugs will be changed to another ML (the one I currently redirecting you to).

Quoted 12 lines

Subject:
please attempt to minimize string changes
From:
Benno Schulenberg <[email protected]>
Date:
Sat, 21 Dec 2013 23:12:38 +0100
To:
[email protected]

Hello developers,

Quoted 10 lines

While updating the Dutch translations of grub's messages, I notice that some strings have changed in unnecessary ways. The change that makes me write this mail is the one in util/grub-mkrescue.c, lines 215-217. Those three lines were gettextized separately, which was very well, because they are separate paragrahs. Now they are a single string, which is not only unwieldy, and ungraspable in one view, but also every translator has to concatenate her three previous separate translations into a single one. Unneeded work. Please gettextize those paragraphs again separately, so the translations need to be tweaked only slightly.

grub-mkrescue was rewritten in C and current segmentation is imposed by argp. I don't know if there is a way to put old strings there. Perhaps someone more familiar with srgp could help?

Quoted 9 lines

In general, when extending a text, please consider whether the addition can be seen as an independent sentence. If so, then please gettextize it separately.

By the way, in grub-core/commands/terminal.c, couldn't
"[--append|--remove] [TERMINAL1] [TERMINAL2] ..."
simply be:
"[--append|--remove] [TERMINAL...]"?

I find second less clear since it's more difficult to guess that the "..." stands for ("[TERMINAL3]",...)

When proofreading Ukrainian and French translations we've found a number of unclear msgids. I'll make beta2 tomorrow to reflect those changes.

#3 lore raw

В Вс, 22/12/2013 в 00:55 +0100, Vladimir 'φ-coder/phcoder' Serbinenko пишет:

Quoted 11 lines
Quoted 11 lines

While updating the Dutch translations of grub's messages, I notice that some strings have changed in unnecessary ways. The change that makes me write this mail is the one in util/grub-mkrescue.c, lines 215-217. Those three lines were gettextized separately, which was very well, because they are separate paragrahs. Now they are a single string, which is not only unwieldy, and ungraspable in one view, but also every translator has to concatenate her three previous separate translations into a single one. Unneeded work. Please gettextize those paragraphs again separately, so the translations need to be tweaked only slightly.

Quoted 3 lines

grub-mkrescue was rewritten in C and current segmentation is imposed by argp. I don't know if there is a way to put old strings there. Perhaps someone more familiar with srgp could help?

Will below patch help? It also removes trailing dot on the first paragraph which was not present before. Compile tested.

Quoted 9 lines
Quoted 6 lines

By the way, in grub-core/commands/terminal.c, couldn't
"[--append|--remove] [TERMINAL1] [TERMINAL2] ..."
simply be:
"[--append|--remove] [TERMINAL...]"?

I find second less clear since it's more difficult to guess that the "..." stands for ("[TERMINAL3]",...)

I usually use [TERMINAL ...] (with extra spaces). I find it established enough practice at least in UNIX manuals.

From: Andrey Borzenkov <[email protected]>
Subject: [PATCH] split grub-mkresecue help text to keep existing translations

Reported by Benno Schulenberg

---
 util/grub-mkrescue.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
util/grub-mkrescue.c +3 -3
index ad45f9c..635ae63 100644
@@ -218,9 +218,9 @@ struct argp argp = {
   N_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image.")"\v"
   N_("Generates a bootable CD/USB/floppy image.  Arguments other than options to this program"
      " are passed to xorriso, and indicate source files, source directories, or any of the "
-     "mkisofs options listed by the output of `%s'.\n\n"
-     "Option -- switches to native xorriso command mode.\n\n"
-     "Mail xorriso support requests to <[email protected]>."), 
+     "mkisofs options listed by the output of `%s'\n") "\n"
+     N_("Option -- switches to native xorriso command mode.") "\n\n"
+     N_("Mail xorriso support requests to <[email protected]>."), 
   NULL, help_filter, NULL
 };
 
Signature · 1 line
tg: (bf08219..) u/grub-mkrescue-i18n (depends on: master)
#4 lore raw
Quoted 47 lines · Andrey Borzenkov

В Вс, 22/12/2013 в 00:55 +0100, Vladimir 'φ-coder/phcoder' Serbinenko пишет:

Quoted 11 lines
Quoted 11 lines

While updating the Dutch translations of grub's messages, I notice that some strings have changed in unnecessary ways. The change that makes me write this mail is the one in util/grub-mkrescue.c, lines 215-217. Those three lines were gettextized separately, which was very well, because they are separate paragrahs. Now they are a single string, which is not only unwieldy, and ungraspable in one view, but also every translator has to concatenate her three previous separate translations into a single one. Unneeded work. Please gettextize those paragraphs again separately, so the translations need to be tweaked only slightly.

Quoted 3 lines

grub-mkrescue was rewritten in C and current segmentation is imposed by argp. I don't know if there is a way to put old strings there. Perhaps someone more familiar with srgp could help?

Will below patch help? It also removes trailing dot on the first paragraph which was not present before. Compile tested.

Quoted 9 lines
Quoted 6 lines

By the way, in grub-core/commands/terminal.c, couldn't
"[--append|--remove] [TERMINAL1] [TERMINAL2] ..."
simply be:
"[--append|--remove] [TERMINAL...]"?

I find second less clear since it's more difficult to guess that the "..." stands for ("[TERMINAL3]",...)

I usually use [TERMINAL ...] (with extra spaces). I find it established enough practice at least in UNIX manuals.

From: Andrey Borzenkov <[email protected]>
Subject: [PATCH] split grub-mkresecue help text to keep existing translations

Reported by Benno Schulenberg

---
 util/grub-mkrescue.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
util/grub-mkrescue.c +0 -0
index ad45f9c..635ae63 100644

util/grub-mkrescue.c struct argp argp = { · line 223

Quoted 9 lines
util/grub-mkrescue.c +3 -3
@@ -218,9 +218,9 @@ struct argp argp = {
   N_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image.")"\v"
   N_("Generates a bootable CD/USB/floppy image.  Arguments other than options to this program"
      " are passed to xorriso, and indicate source files, source directories, or any of the "
-     "mkisofs options listed by the output of `%s'.\n\n"
-     "Option -- switches to native xorriso command mode.\n\n"
-     "Mail xorriso support requests to <[email protected]>."), 
+     "mkisofs options listed by the output of `%s'\n") "\n"
+     N_("Option -- switches to native xorriso command mode.") "\n\n"
+     N_("Mail xorriso support requests to <[email protected]>."), 

N_ is not a function, it only marks string for translation for gettext. argp will see the whole string with no indication how N_ was used. It will resplit the string at \v and pass both halves to gettext which will fail to find the second half in the catalog

Quoted 11 lines
util/grub-mkrescue.c +0 -0
   NULL, help_filter, NULL
 };
 

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#5 lore raw

В Вс, 22/12/2013 в 12:31 +0100, Vladimir 'φ-coder/phcoder' Serbinenko пишет:

Quoted 5 lines

N_ is not a function, it only marks string for translation for gettext. argp will see the whole string with no indication how N_ was used. It will resplit the string at \v and pass both halves to gettext which will fail to find the second half in the catalog

OK, I see. In this case verbatim replacement using separately translatable strings would be patch below (I actually tested it using old catalog, which works with exception of sentence in question, which changed too much). Is there any reason "xorriso ..." is not part of string? It would make it even more simple.

From: Andrey Borzenkov <[email protected]>
Subject: [PATCH] split grub-mkresecue help text to facilitate translations

Reported by Benno Schulenberg

---
 util/grub-mkrescue.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
util/grub-mkrescue.c +16 -9
index ad45f9c..ad132ef 100644
@@ -119,8 +119,22 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
 {
   switch (key)
     {
+    case ARGP_KEY_HELP_PRE_DOC:
+      /* TRANSLATORS: it generates one single image which is bootable through any method. */
+      return strdup (_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image."));
     case ARGP_KEY_HELP_POST_DOC:
-      return xasprintf (text, "xorriso -as mkisofs -help");
+      {
+	char *p1, *out;
+
+	p1 = xasprintf (_("Generates a bootable CD/USB/floppy image.  Arguments other than options to this program"
+      " are passed to xorriso, and indicate source files, source directories, or any of the "
+      "mkisofs options listed by the output of `%s'."), "xorriso -as mkisofs -help");
+	out = xasprintf ("%s\n\n%s\n\n%s", p1,
+	  _("Option -- switches to native xorriso command mode."),
+	  _("Mail xorriso support requests to <[email protected]>."));
+	free (p1);
+	return out;
+      }
     default:
       return grub_install_help_filter (key, text, input);
     }
@@ -214,14 +228,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
 
 struct argp argp = {
   options, argp_parser, N_("[OPTION] SOURCE..."),
-  /* TRANSLATORS: it generates one single image which is bootable through any method. */
-  N_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image.")"\v"
-  N_("Generates a bootable CD/USB/floppy image.  Arguments other than options to this program"
-     " are passed to xorriso, and indicate source files, source directories, or any of the "
-     "mkisofs options listed by the output of `%s'.\n\n"
-     "Option -- switches to native xorriso command mode.\n\n"
-     "Mail xorriso support requests to <[email protected]>."), 
-  NULL, help_filter, NULL
+  NULL, NULL, help_filter, NULL
 };
 
 static void
Signature · 1 line
tg: (bf08219..) u/grub-mkrescue-i18n (depends on: master)
#6 lore raw
Quoted 8 lines · Andrey Borzenkov

В Вс, 22/12/2013 в 12:31 +0100, Vladimir 'φ-coder/phcoder' Serbinenko пишет:

Quoted 5 lines

N_ is not a function, it only marks string for translation for gettext. argp will see the whole string with no indication how N_ was used. It will resplit the string at \v and pass both halves to gettext which will fail to find the second half in the catalog

Quoted 6 lines

OK, I see. In this case verbatim replacement using separately translatable strings would be patch below (I actually tested it using old catalog, which works with exception of sentence in question, which changed too much). Is there any reason "xorriso ..." is not part of string? It would make it even more simple.

It's bad idea to have commands as part of translatable strings. Suppose command changes, then the string will become fuzzy. If unfuzzying is done too quickly we may end up with a wrong command altogether. Patch is good for me.
@Benne: does it address your concern?

Quoted 54 lines

From: Andrey Borzenkov <[email protected]>
Subject: [PATCH] split grub-mkresecue help text to facilitate translations

Reported by Benno Schulenberg

---
 util/grub-mkrescue.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
util/grub-mkrescue.c +16 -9
index ad45f9c..ad132ef 100644
@@ -119,8 +119,22 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
 {
   switch (key)
     {
+    case ARGP_KEY_HELP_PRE_DOC:
+      /* TRANSLATORS: it generates one single image which is bootable through any method. */
+      return strdup (_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image."));
     case ARGP_KEY_HELP_POST_DOC:
-      return xasprintf (text, "xorriso -as mkisofs -help");
+      {
+	char *p1, *out;
+
+	p1 = xasprintf (_("Generates a bootable CD/USB/floppy image.  Arguments other than options to this program"
+      " are passed to xorriso, and indicate source files, source directories, or any of the "
+      "mkisofs options listed by the output of `%s'."), "xorriso -as mkisofs -help");
+	out = xasprintf ("%s\n\n%s\n\n%s", p1,
+	  _("Option -- switches to native xorriso command mode."),
+	  _("Mail xorriso support requests to <[email protected]>."));
+	free (p1);
+	return out;
+      }
     default:
       return grub_install_help_filter (key, text, input);
     }
@@ -214,14 +228,7 @@ argp_parser (int key, char *arg, struct argp_state *state)
 
 struct argp argp = {
   options, argp_parser, N_("[OPTION] SOURCE..."),
-  /* TRANSLATORS: it generates one single image which is bootable through any method. */
-  N_("Make GRUB CD-ROM, disk, pendrive and floppy bootable image.")"\v"
-  N_("Generates a bootable CD/USB/floppy image.  Arguments other than options to this program"
-     " are passed to xorriso, and indicate source files, source directories, or any of the "
-     "mkisofs options listed by the output of `%s'.\n\n"
-     "Option -- switches to native xorriso command mode.\n\n"
-     "Mail xorriso support requests to <[email protected]>."), 
-  NULL, help_filter, NULL
+  NULL, NULL, help_filter, NULL
 };
 
 static void
#8 lore raw
In reply to Andrey Borzenkov
Quoted 2 lines · Andrey Borzenkov

Will below patch help? It also removes trailing dot on the first paragraph which was not present before.

Thanks, the patch looks good. Except that the trailing dot needs to be there: it is a doc string and should end in a period. The addition of the dot was an improvement. :)

The general rule is: when the string starts with a capitalized word, it wants to be a full sentence and should end in a period. When the message starts with a lowercase letter, don't use a period anywhere in the message; when you need a second sentence, use a semicolon.

Quoted 2 lines

I usually use [TERMINAL ...] (with extra spaces). I find it established enough practice at least in UNIX manuals.

Indeed. Although in most of the man pages I've looked at just now (df, ls, grep, sed, swapon, gawk), only gawk uses a space before the dots. But whatever you choose, please make it consistent across grub -- I've seen at least one instance without a space before the dots in grub's messages.

Regards,

Benno

Signature · 1 line
http://www.fastmail.fm - mmm... Fastmail...
#10 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 4 lines · Vladimir 'φ-coder/phcoder' Serbinenko

Hello, currently bug-grub is subscriber-only list. I'll think of how to change this. Probably it will be changed to moderated or the mail for msgid bugs will be changed to another ML (the one I currently redirecting you to).

Thanks. Yes, the devel list would be good, I think.

Quoted 7 lines
Quoted 4 lines

By the way, in grub-core/commands/terminal.c, couldn't
"[--append|--remove] [TERMINAL1] [TERMINAL2] ..."
simply be:
"[--append|--remove] [TERMINAL...]"?

I find second less clear since it's more difficult to guess that the "..." stands for ("[TERMINAL3]",...)

As Andrey pointed out, it is the standard way in Unix manuals, the dots meaning: "as many more of the preceding as you want".

And the dots are used that way in many other places in grub, and therefore seeing "[TERMINAL1] [TERMINAL2] ..." confuses me -- do I have to provdide two terminals? no, the first is optional, ehm, and the second too, ehm, so why are two mentioned?

Quoted 2 lines

When proofreading Ukrainian and French translations we've found a number of unclear msgids. I'll make beta2 tomorrow to reflect those changes.

Okay, thanks.

Regards,

Benno

Signature · 1 line
http://www.fastmail.fm - The professional email service
#9 lore raw
In reply to Benno Schulenberg
Quoted 9 lines · Benno Schulenberg
Quoted 2 lines · Andrey Borzenkov

Will below patch help? It also removes trailing dot on the first paragraph which was not present before.

Thanks, the patch looks good. Except that the trailing dot needs to be there: it is a doc string and should end in a period. The addition of the dot was an improvement. :)

@Andrey. Could you commit your patch with this suggestion? Thanks

Quoted 18 lines

The general rule is: when the string starts with a capitalized word, it wants to be a full sentence and should end in a period. When the message starts with a lowercase letter, don't use a period anywhere in the message; when you need a second sentence, use a semicolon.

Quoted 2 lines

I usually use [TERMINAL ...] (with extra spaces). I find it established enough practice at least in UNIX manuals.

Indeed. Although in most of the man pages I've looked at just now (df, ls, grep, sed, swapon, gawk), only gawk uses a space before the dots. But whatever you choose, please make it consistent across grub -- I've seen at least one instance without a space before the dots in grub's messages.

Regards,

Benno