From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NO9T2-0001OM-4l for mharc-grub-devel@gnu.org; Fri, 25 Dec 2009 07:40:28 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NO9T0-0001Mo-6w for grub-devel@gnu.org; Fri, 25 Dec 2009 07:40:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NO9Sv-0001LS-Q9 for grub-devel@gnu.org; Fri, 25 Dec 2009 07:40:25 -0500 Received: from [199.232.76.173] (port=53081 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NO9Sv-0001LJ-MK for grub-devel@gnu.org; Fri, 25 Dec 2009 07:40:21 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:50231 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NO9Su-0002uU-TE for grub-devel@gnu.org; Fri, 25 Dec 2009 07:40:21 -0500 Received: from pinux (unknown [192.168.0.108]) by mail.pina.cat (Postfix) with ESMTP id 09AF8288F2FE0 for ; Fri, 25 Dec 2009 13:40:20 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id 30D4410BC0; Fri, 25 Dec 2009 12:40:40 +0000 (GMT) Date: Fri, 25 Dec 2009 13:40:40 +0100 From: Carles Pina i Estany To: The development of GNU GRUB Message-ID: <20091225124040.GA20011@pina.cat> References: <20091225115031.GA14251@pina.cat> <4B34AD01.9010908@gmail.com> <20091225122918.GB17270@pina.cat> <4B34B117.6080906@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX" Content-Disposition: inline In-Reply-To: <4B34B117.6080906@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: gettext: help commands X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 12:40:26 -0000 --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --huq684BweRXVnRxX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gettext_help4.patch" === 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 #include #include +#include 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) --huq684BweRXVnRxX--