From: Carles Pina i Estany <carles@pina.cat>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Build failures on Ubuntu due to gettext
Date: Wed, 9 Dec 2009 23:57:27 +0000 [thread overview]
Message-ID: <20091209235727.GA18509@pina.cat> (raw)
In-Reply-To: <4B1D9AA2.6060505@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 868 bytes --]
Hi Vladimir, Colin,
On Dec/08/2009, Vladimir '??-coder/phcoder' Serbinenko wrote:
> > My patch made the following transformation:
> >
> > - grub_printf (_("literal string"));
> > + grub_printf ("%s", _("literal string"));
> >
> > This was only necessary in five places, so I doubt that a function is
> > worth it.
> >
> Then it's not worth it. But again we haven't gettext'ized whole grub2
> yet to know for sure. Perhaps a macro so we can change it later if
> necessary?
Vladimir, Colin: see the attached patch with the Colin changes but
macrofied.
Should compile fine in Ubuntu, but I have not tried.
Are we happy with grub_put_ function name?
Colin: could you apply this patch or similar?
I don't want to push more gettext strings before setting up the basic
infrastructure to avoid working twice.
Thanks,
--
Carles Pina i Estany
http://pinux.info
[-- Attachment #2: grub_put_.patch --]
[-- Type: text/x-diff, Size: 2099 bytes --]
=== modified file 'include/grub/misc.h'
--- include/grub/misc.h 2009-12-08 00:08:52 +0000
+++ include/grub/misc.h 2009-12-09 23:51:07 +0000
@@ -34,6 +34,8 @@
/* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */
#define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n))
+#define grub_put_(str) grub_printf("%s", (str))
+
void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c);
=== modified file 'normal/menu_entry.c'
--- normal/menu_entry.c 2009-12-08 00:08:52 +0000
+++ normal/menu_entry.c 2009-12-09 23:46:36 +0000
@@ -1000,7 +1000,7 @@ run (struct screen *screen)
grub_cls ();
grub_printf (" ");
- grub_printf_ (N_("Booting a command list"));
+ grub_put_ (N_("Booting a command list"));
grub_printf ("\n\n");
@@ -1182,6 +1182,6 @@ grub_menu_entry_run (grub_menu_entry_t e
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
grub_putchar ('\n');
- grub_printf_ (N_("Press any key to continue..."));
+ grub_put_ (N_("Press any key to continue..."));
(void) grub_getkey ();
}
=== modified file 'normal/menu_text.c'
--- normal/menu_text.c 2009-12-08 00:08:52 +0000
+++ normal/menu_text.c 2009-12-09 23:47:04 +0000
@@ -40,7 +40,7 @@ void
grub_wait_after_message (void)
{
grub_putchar ('\n');
- grub_printf_ (N_("Press any key to continue..."));
+ grub_put_ (N_("Press any key to continue..."));
(void) grub_getkey ();
grub_putchar ('\n');
}
@@ -206,7 +206,7 @@ entry is highlighted.");
if (nested)
{
grub_printf ("\n ");
- grub_printf_ (N_("ESC to return previous menu."));
+ grub_put_ (N_("ESC to return previous menu."));
}
}
}
@@ -655,7 +655,7 @@ notify_execution_failure (void *userdata
grub_errno = GRUB_ERR_NONE;
}
grub_printf ("\n ");
- grub_printf_ (N_("Failed to boot default entries.\n"));
+ grub_put_ (N_("Failed to boot default entries.\n"));
grub_wait_after_message ();
}
next prev parent reply other threads:[~2009-12-09 23:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-07 14:09 Build failures on Ubuntu due to gettext Colin Watson
2009-12-07 20:14 ` Carles Pina i Estany
2009-12-07 20:54 ` Colin Watson
2009-12-07 22:46 ` Carles Pina i Estany
2009-12-07 23:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-07 23:57 ` Colin Watson
2009-12-07 23:38 ` Carles Pina i Estany
2009-12-07 23:59 ` Colin Watson
2009-12-08 0:00 ` Colin Watson
2009-12-08 0:14 ` Carles Pina i Estany
2009-12-07 22:04 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-07 23:12 ` Colin Watson
2009-12-07 23:38 ` Colin Watson
2009-12-07 23:59 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-08 0:10 ` Colin Watson
2009-12-08 0:15 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-09 23:57 ` Carles Pina i Estany [this message]
2009-12-10 0:07 ` Carles Pina i Estany
2009-12-10 0:38 ` Carles Pina i Estany
2009-12-10 1:10 ` Robert Millan
2009-12-11 0:04 ` Carles Pina i Estany
2009-12-07 23:18 ` 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=20091209235727.GA18509@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.