All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carles Pina i Estany <carles@pina.cat>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: gettext: help commands
Date: Fri, 25 Dec 2009 13:40:40 +0100	[thread overview]
Message-ID: <20091225124040.GA20011@pina.cat> (raw)
In-Reply-To: <4B34B117.6080906@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]


Hi,

On Dec/25/2009, Vladimir '??-coder/phcoder' Serbinenko wrote:
 
> Now 'desclen' is out of sync with message

(arf, rushing for Christmas lunch :-) )

Now all cmd->summary and cmd->description in commands/help.c are
gettextizzed. I've reviewed lib/arg.c and was fine. 

Thanks Vladimir,

-- 
Carles Pina i Estany
	http://pinux.info

[-- Attachment #2: gettext_help4.patch --]
[-- Type: text/x-diff, Size: 1677 bytes --]

=== modified file 'commands/help.c'
--- commands/help.c	2009-06-10 21:04:23 +0000
+++ commands/help.c	2009-12-25 12:36:54 +0000
@@ -21,6 +21,7 @@
 #include <grub/misc.h>
 #include <grub/term.h>
 #include <grub/extcmd.h>
+#include <grub/i18n.h>
 
 static grub_err_t
 grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
@@ -38,13 +39,13 @@ grub_cmd_help (grub_extcmd_t ext __attri
 	  (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE))
 	{
 	  char description[GRUB_TERM_WIDTH / 2];
-	  int desclen = grub_strlen (cmd->summary);
+	  int desclen = grub_strlen (_(cmd->summary));
 
 	  /* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled
 	     with the description followed by spaces.  */
 	  grub_memset (description, ' ', GRUB_TERM_WIDTH / 2 - 1);
 	  description[GRUB_TERM_WIDTH / 2 - 1] = '\0';
-	  grub_memcpy (description, cmd->summary,
+	  grub_memcpy (description, _(cmd->summary),
 		       (desclen < GRUB_TERM_WIDTH / 2 - 1
 			? desclen : GRUB_TERM_WIDTH / 2 - 1));
 
@@ -65,8 +66,8 @@ grub_cmd_help (grub_extcmd_t ext __attri
 	      if (cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)
 		grub_arg_show_help ((grub_extcmd_t) cmd->data);
 	      else
-		grub_printf ("Usage: %s\n%s\b", cmd->summary,
-			     cmd->description);
+		grub_printf ("%s %s\n%s\b", _("Usage:"), _(cmd->summary),
+			     _(cmd->description));
 	    }
 	}
       return 0;
@@ -94,8 +95,8 @@ GRUB_MOD_INIT(help)
 {
   cmd = grub_register_extcmd ("help", grub_cmd_help,
 			      GRUB_COMMAND_FLAG_CMDLINE,
-			      "help [PATTERN ...]",
-			      "Show a help message.", 0);
+			      N_("help [PATTERN ...]"),
+			      N_("Show a help message."), 0);
 }
 
 GRUB_MOD_FINI(help)


  reply	other threads:[~2009-12-25 12:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-25 11:50 gettext: help commands Carles Pina i Estany
2009-12-25 12:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-25 12:29   ` Carles Pina i Estany
2009-12-25 12:33     ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-25 12:40       ` Carles Pina i Estany [this message]
2009-12-25 12:27 ` Carles Pina i Estany

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091225124040.GA20011@pina.cat \
    --to=carles@pina.cat \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.