Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NO9OF-0007jS-0S for mharc-grub-devel@gnu.org; Fri, 25 Dec 2009 07:35:31 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NO9OC-0007jA-9H for grub-devel@gnu.org; Fri, 25 Dec 2009 07:35:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NO9O7-0007ii-PM for grub-devel@gnu.org; Fri, 25 Dec 2009 07:35:27 -0500 Received: from [199.232.76.173] (port=43365 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NO9O7-0007iX-GZ for grub-devel@gnu.org; Fri, 25 Dec 2009 07:35:23 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:39296 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NO9O7-0002NC-34 for grub-devel@gnu.org; Fri, 25 Dec 2009 07:35:23 -0500 Received: from pinux (unknown [192.168.0.108]) by mail.pina.cat (Postfix) with ESMTP id 4C8D8288F2FE0 for ; Fri, 25 Dec 2009 13:35:22 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id 741CD17C10; Fri, 25 Dec 2009 12:35:42 +0000 (GMT) Date: Fri, 25 Dec 2009 13:35:42 +0100 From: Carles Pina i Estany To: grub-devel@gnu.org Message-ID: <20091225123542.GC17270@pina.cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: gettext: lib/arg.c 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:35:28 -0000 Hi, My previous patch touches lib/arg.c, and I would commit that patch but we should fix something that will happen there. lib/arg.c does: const char *doc = _(opt->doc); for (;;) { while (spacing-- > 0) grub_putchar (' '); while (*doc && *doc != '\n') grub_putchar (*doc++); grub_putchar ('\n'); if (! *doc) break; doc++; spacing = 4 + 20; } so, is cutting the string doc using \n, and the after \n inserting spaces. If the developer or the programmer does't write \n in the correct place (so the string is too long) it's not correctly formatted on screen. I wanted to use grub_print_message_indented (I could insert spaces until margin_left checking the current x position). But if I call from lib/arg.c grub_print_message_indented it's needed to link fstest with all terminal stuff. I tried but dependencies goes quite far. So, I'm thinking to do something like: char *doc = _(opt->doc); insert_newlines(doc) for (;;) { } insert_newlines will insert newlines in the appropiate places. So developers and translators doesn't need to think about how to format the message. Because it's not terminal dependant it will maybe not use all terminal width in terminals bigger than 80 characters. How it sounds? Other approach would be to use grub_print_message_indented, dependencies will affect mainly fstest (it use lib/arg.c). Or have a dummy grub_print_message_indented for fstest. -- Carles Pina i Estany http://pinux.info