Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHRnT-0006Ba-E2 for mharc-grub-devel@gnu.org; Sun, 06 Dec 2009 19:49:51 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHRnR-0006B4-0v for grub-devel@gnu.org; Sun, 06 Dec 2009 19:49:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHRnM-0006AU-3M for grub-devel@gnu.org; Sun, 06 Dec 2009 19:49:48 -0500 Received: from [199.232.76.173] (port=59427 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHRnL-0006AR-TY for grub-devel@gnu.org; Sun, 06 Dec 2009 19:49:43 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:59843 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHRnL-0002Qp-Py for grub-devel@gnu.org; Sun, 06 Dec 2009 19:49:44 -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 CA8DC288F3009 for ; Mon, 7 Dec 2009 01:49:41 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id EF4122F1A; Mon, 7 Dec 2009 00:49:51 +0000 (GMT) Date: Mon, 7 Dec 2009 00:49:51 +0000 From: Carles Pina i Estany To: grub-devel@gnu.org Message-ID: <20091207004951.GA21460@pina.cat> References: <20091206182228.GA15091@pina.cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091206182228.GA15091@pina.cat> 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: 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: Mon, 07 Dec 2009 00:49:49 -0000 Hi, On Dec/06/2009, Carles Pina i Estany wrote: > - grub_printf ("The files are identical.\n"); > + grub_printf (_("The files are identical.\n")); Vladimir suggested in IRC that instead of using: grub_printf (grub_gettext (str)) // This is with _() expanded I could use: grub_printf_ (str); To reduce the size in disk. I suggest to implement something like: grub_printf_ (N_("bla bla %s bla"), msg); And then implement grub_printf_: --------- int grub_printf_ (const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); ret = grub_vprintf (_(fmt), ap); va_end (ap); return ret; } --------- AFAIK, xgettext keyword (-k) needs that the keyword wraps the string, in order to extract it to the .pot file, so it's not possible to do a very generic function like: grub_printf_ ("bla bla %s bla", msg); xgettext would not extract the string. Maybe Jordi has something to say about this last part. If we want this approach tell me: I would implement it soon and prepare a patch with the implementation, then redo "gettext: normal/*" patch with this new approach, adapt the old code and finally do the commands/* "again" and move from here (still some more files and things to do). Thanks, -- Carles Pina i Estany http://pinux.info