Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NH1TO-0000q2-ND for mharc-grub-devel@gnu.org; Sat, 05 Dec 2009 15:43:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NH1TN-0000o0-7W for grub-devel@gnu.org; Sat, 05 Dec 2009 15:43:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NH1TI-0000hn-9A for grub-devel@gnu.org; Sat, 05 Dec 2009 15:43:20 -0500 Received: from [199.232.76.173] (port=57217 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH1TI-0000he-4J for grub-devel@gnu.org; Sat, 05 Dec 2009 15:43:16 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:55992 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NH1TH-00077J-6J for grub-devel@gnu.org; Sat, 05 Dec 2009 15:43:15 -0500 Received: from pinux (82-45-164-87.cable.ubr06.hari.blueyonder.co.uk [82.45.164.87]) by mail.pina.cat (Postfix) with ESMTP id 3C151288F2FE0 for ; Sat, 5 Dec 2009 21:43:14 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id 6B873947F; Sat, 5 Dec 2009 20:43:24 +0000 (GMT) Date: Sat, 5 Dec 2009 20:43:24 +0000 From: Carles Pina i Estany To: The development of GNU GRUB Message-ID: <20091205204324.GA7066@pina.cat> References: <20091205193102.GA25867@pina.cat> <20091205202423.GB32638@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <20091205202423.GB32638@thorin> 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: normal/* 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: Sat, 05 Dec 2009 20:43:21 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Dec/05/2009, Robert Millan wrote: > > There is one string in function grub_normal_reader_init: > > > > ------- > > grub_printf (_("\ > > [ Minimal BASH-like line editing is supported. For the first word, TAB\n\ > > lists possible command completions. Anywhere else TAB lists possible\n\ > > device/file completions.%s ]\n\n"), > > reader_nested ? " ESC at any time exits." : ""); > > ------- > Doesn't matter. But if you do this, please remove the brackets. Now it's indented like the other indented messages. See the attached patch. If needed I can reduce the left and right margins (adding a parameter to print_message_indented). Tested in my system and works fine in English and my Catalan draft. If it's fine I would commit. Thanks, -- Carles Pina i Estany http://pinux.info --0F1p//8PRICkK4MW Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gettext_normal_last.patch" === modified file 'include/grub/normal.h' --- include/grub/normal.h 2009-08-24 23:55:06 +0000 +++ include/grub/normal.h 2009-12-05 20:14:56 +0000 @@ -73,6 +73,7 @@ void grub_parse_color_name_pair (grub_ui /* Defined in `menu_text.c'. */ void grub_wait_after_message (void); +void print_message_indented (const char *msg); /* Defined in `handler.c'. */ void read_handler_list (void); === modified file 'normal/auth.c' --- normal/auth.c 2009-11-09 14:30:47 +0000 +++ normal/auth.c 2009-12-05 19:10:45 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include struct grub_auth_user { @@ -237,7 +238,7 @@ grub_auth_check_authentication (const ch return GRUB_ERR_NONE; } - if (!grub_cmdline_get ("Enter username: ", login, sizeof (login) - 1, + if (!grub_cmdline_get (_("Enter username: "), login, sizeof (login) - 1, 0, 0, 0)) goto access_denied; === modified file 'normal/color.c' --- normal/color.c 2008-03-26 13:01:02 +0000 +++ normal/color.c 2009-12-05 19:12:14 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include /* Borrowed from GRUB Legacy */ static char *color_list[16] = @@ -76,7 +77,7 @@ grub_parse_color_name_pair (grub_uint8_t bg_name = grub_strchr (fg_name, '/'); if (bg_name == NULL) { - grub_printf ("Warning: syntax error (missing slash) in `%s'\n", fg_name); + grub_printf (_("Warning: syntax error (missing slash) in `%s'\n"), fg_name); grub_wait_after_message (); goto free_and_return; } @@ -85,13 +86,13 @@ grub_parse_color_name_pair (grub_uint8_t if (parse_color_name (&fg, fg_name) == -1) { - grub_printf ("Warning: invalid foreground color `%s'\n", fg_name); + grub_printf (_("Warning: invalid foreground color `%s'\n"), fg_name); grub_wait_after_message (); goto free_and_return; } if (parse_color_name (&bg, bg_name) == -1) { - grub_printf ("Warning: invalid background color `%s'\n", bg_name); + grub_printf (_("Warning: invalid background color `%s'\n"), bg_name); grub_wait_after_message (); goto free_and_return; } === modified file 'normal/main.c' --- normal/main.c 2009-11-25 03:48:33 +0000 +++ normal/main.c 2009-12-05 20:36:30 +0000 @@ -509,11 +509,19 @@ grub_normal_reader_init (void) grub_normal_init_page (); grub_setcursor (1); - grub_printf (_("\ - [ Minimal BASH-like line editing is supported. For the first word, TAB\n\ - lists possible command completions. Anywhere else TAB lists possible\n\ - device/file completions.%s ]\n\n"), - reader_nested ? " ESC at any time exits." : ""); + const char *msg = _("Minimal BASH-like line editing is supported. For \ +the first word, TAB lists possible command completions. Anywhere else TAB \ +lists possible device/file completions. %s"); + const char *msg_esc = _("ESC at any time exits."); + + char *msg_formatted = grub_malloc (sizeof (char) * (grub_strlen (msg) + + grub_strlen(msg_esc) + 1)); + + grub_sprintf (msg_formatted, msg, reader_nested ? msg_esc : ""); + print_message_indented (msg_formatted); + grub_printf ("\n\n"); + + grub_free (msg_formatted); return 0; } === modified file 'normal/menu_text.c' --- normal/menu_text.c 2009-12-05 11:25:07 +0000 +++ normal/menu_text.c 2009-12-05 20:30:23 +0000 @@ -77,7 +77,7 @@ getstringwidth (grub_uint32_t * str, con return width; } -static void +void print_message_indented (const char *msg) { const int line_len = GRUB_TERM_WIDTH - grub_getcharwidth ('m') * 15; === modified file 'normal/misc.c' --- normal/misc.c 2009-06-10 21:04:23 +0000 +++ normal/misc.c 2009-12-05 19:18:21 +0000 @@ -24,6 +24,8 @@ #include #include #include +#include +#include /* Print the information on the device NAME. */ grub_err_t @@ -34,13 +36,16 @@ grub_normal_print_device_info (const cha p = grub_strchr (name, ','); if (p) - grub_printf ("\tPartition %s: ", name); + { + grub_putchar ('\t'); + grub_printf (_("Partition %s: "), name); + } else - grub_printf ("Device %s: ", name); + grub_printf (_("Device %s: "), name); dev = grub_device_open (name); if (! dev) - grub_printf ("Filesystem cannot be accessed"); + grub_printf (_("Filesystem cannot be accessed")); else if (dev->disk) { grub_fs_t fs; @@ -51,7 +56,7 @@ grub_normal_print_device_info (const cha if (fs) { - grub_printf ("Filesystem type %s", fs->name); + grub_printf (_("Filesystem type %s"), fs->name); if (fs->label) { char *label; @@ -59,7 +64,7 @@ grub_normal_print_device_info (const cha if (grub_errno == GRUB_ERR_NONE) { if (label && grub_strlen (label)) - grub_printf (", Label %s", label); + grub_printf (_(", Label %s"), label); grub_free (label); } grub_errno = GRUB_ERR_NONE; @@ -72,8 +77,8 @@ grub_normal_print_device_info (const cha if (grub_errno == GRUB_ERR_NONE) { grub_unixtime2datetime (tm, &datetime); - grub_printf (", Last modification time %d-%02d-%02d " - "%02d:%02d:%02d %s", + grub_printf (_(", Last modification time %d-%02d-%02d " + "%02d:%02d:%02d %s"), datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second, grub_get_weekday_name (&datetime)); @@ -95,9 +100,9 @@ grub_normal_print_device_info (const cha } } else if (! dev->disk->has_partitions || dev->disk->partition) - grub_printf ("Unknown filesystem"); + grub_printf (_("Unknown filesystem")); else - grub_printf ("Partition table"); + grub_printf (_("Partition table")); grub_device_close (dev); } === modified file 'po/POTFILES' --- po/POTFILES 2009-12-05 11:25:07 +0000 +++ po/POTFILES 2009-12-05 20:36:51 +0000 @@ -11,5 +11,9 @@ util/mkisofs/rock.c util/mkisofs/tree.c util/mkisofs/write.c +normal/auth.c +normal/color.c +normal/main.c normal/menu_entry.c normal/menu_text.c +normal/misc.c --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ChangeLog.normal_last" 2009-12-05 Carles Pina i Estany * include/grub/normal.h: Declare print_message_indented. * normal/auth.c: Include `'. (grub_auth_check_authentication): Gettexttize string. * normal/color.c: Include `'. (grub_parse_color_name_pair): Gettexttize strings. * normal/main.c (grub_normal_reader_init): Cleanup gettexttized string. * normal/menu_text.c (print_message_indented): Remove `static' qualifer (this function is now used in normal/main.c). * normal/misc.c: Include `' and `'. (grub_normal_print_device_info): Gettexttize strings. * po/POTFILES: Add auth.c, color.c, main.c and misc.c --0F1p//8PRICkK4MW--