2009-12-08 Carles Pina i Estany <carles@pina.cat>

* include/grub/misc.h (grub_printf_): New declaration.
	* kern/misc.c (grub_printf_): New definition.
	* normal/main.c (grub_normal_reader_init): Use `grub_printf_' and `N_'
	instead of `grub_printf' and `_'.
	* normal/menu_entry.c (store_completion): Likewise.
	(run): Likewise.
	(grub_menu_entry_run): Likewise.
	* normal/menu_text.c (grub_wait_after_message): Likewise.
	(notify_booting): Likewise.
	(notify_fallback): Likewise.
	(notify_execution_failure): Likewise.
This commit is contained in:
Carles Pina i Estany 2009-12-08 00:08:52 +00:00
parent d6ceebf1d9
commit e3069ec1a5
6 changed files with 37 additions and 9 deletions

View file

@ -1,3 +1,17 @@
2009-12-08 Carles Pina i Estany <carles@pina.cat>
* include/grub/misc.h (grub_printf_): New declaration.
* kern/misc.c (grub_printf_): New definition.
* normal/main.c (grub_normal_reader_init): Use `grub_printf_' and `N_'
instead of `grub_printf' and `_'.
* normal/menu_entry.c (store_completion): Likewise.
(run): Likewise.
(grub_menu_entry_run): Likewise.
* normal/menu_text.c (grub_wait_after_message): Likewise.
(notify_booting): Likewise.
(notify_fallback): Likewise.
(notify_execution_failure): Likewise.
2009-12-07 Colin Watson <cjwatson@ubuntu.com> 2009-12-07 Colin Watson <cjwatson@ubuntu.com>
* configure.ac: Check for vasprintf. * configure.ac: Check for vasprintf.

View file

@ -171,6 +171,7 @@ char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n);
void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n); void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
grub_size_t EXPORT_FUNC(grub_strlen) (const char *s); grub_size_t EXPORT_FUNC(grub_strlen) (const char *s);
int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
void EXPORT_FUNC(grub_real_dprintf) (const char *file, void EXPORT_FUNC(grub_real_dprintf) (const char *file,
const int line, const int line,
const char *condition, const char *condition,

View file

@ -126,6 +126,19 @@ grub_printf (const char *fmt, ...)
return ret; return ret;
} }
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;
}
#if defined (APPLE_CC) && ! defined (GRUB_UTIL) #if defined (APPLE_CC) && ! defined (GRUB_UTIL)
int int
grub_err_printf (const char *fmt, ...) grub_err_printf (const char *fmt, ...)

View file

@ -509,7 +509,7 @@ grub_normal_reader_init (void)
grub_normal_init_page (); grub_normal_init_page ();
grub_setcursor (1); grub_setcursor (1);
grub_printf (_("\ grub_printf_ (N_("\
[ Minimal BASH-like line editing is supported. For the first word, TAB\n\ [ Minimal BASH-like line editing is supported. For the first word, TAB\n\
lists possible command completions. Anywhere else TAB lists possible\n\ lists possible command completions. Anywhere else TAB lists possible\n\
device/file completions.%s ]\n\n"), device/file completions.%s ]\n\n"),

View file

@ -837,7 +837,7 @@ store_completion (const char *item, grub_completion_type_t type, int count)
grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
grub_printf (" "); grub_printf (" ");
grub_printf (_("Possible %s are:"), what); grub_printf_ (N_("Possible %s are:"), what);
grub_printf ("\n "); grub_printf ("\n ");
} }
@ -1000,7 +1000,7 @@ run (struct screen *screen)
grub_cls (); grub_cls ();
grub_printf (" "); grub_printf (" ");
grub_printf (_("Booting a command list")); grub_printf_ (N_("Booting a command list"));
grub_printf ("\n\n"); grub_printf ("\n\n");
@ -1182,6 +1182,6 @@ grub_menu_entry_run (grub_menu_entry_t entry)
grub_print_error (); grub_print_error ();
grub_errno = GRUB_ERR_NONE; grub_errno = GRUB_ERR_NONE;
grub_putchar ('\n'); grub_putchar ('\n');
grub_printf (_("Press any key to continue...")); grub_printf_ (N_("Press any key to continue..."));
(void) grub_getkey (); (void) grub_getkey ();
} }

View file

@ -40,7 +40,7 @@ void
grub_wait_after_message (void) grub_wait_after_message (void)
{ {
grub_putchar ('\n'); grub_putchar ('\n');
grub_printf (_("Press any key to continue...")); grub_printf_ (N_("Press any key to continue..."));
(void) grub_getkey (); (void) grub_getkey ();
grub_putchar ('\n'); grub_putchar ('\n');
} }
@ -206,7 +206,7 @@ entry is highlighted.");
if (nested) if (nested)
{ {
grub_printf ("\n "); grub_printf ("\n ");
grub_printf (_("ESC to return previous menu.")); grub_printf_ (N_("ESC to return previous menu."));
} }
} }
} }
@ -627,7 +627,7 @@ notify_booting (grub_menu_entry_t entry,
void *userdata __attribute__((unused))) void *userdata __attribute__((unused)))
{ {
grub_printf (" "); grub_printf (" ");
grub_printf (_("Booting \'%s\'"), entry->title); grub_printf_ (N_("Booting \'%s\'"), entry->title);
grub_printf ("\n\n"); grub_printf ("\n\n");
} }
@ -639,7 +639,7 @@ notify_fallback (grub_menu_entry_t entry,
void *userdata __attribute__((unused))) void *userdata __attribute__((unused)))
{ {
grub_printf ("\n "); grub_printf ("\n ");
grub_printf (_("Falling back to \'%s\'"), entry->title); grub_printf_ (N_("Falling back to \'%s\'"), entry->title);
grub_printf ("\n\n"); grub_printf ("\n\n");
grub_millisleep (DEFAULT_ENTRY_ERROR_DELAY_MS); grub_millisleep (DEFAULT_ENTRY_ERROR_DELAY_MS);
} }
@ -655,7 +655,7 @@ notify_execution_failure (void *userdata __attribute__((unused)))
grub_errno = GRUB_ERR_NONE; grub_errno = GRUB_ERR_NONE;
} }
grub_printf ("\n "); grub_printf ("\n ");
grub_printf (_("Failed to boot default entries.\n")); grub_printf_ (N_("Failed to boot default entries.\n"));
grub_wait_after_message (); grub_wait_after_message ();
} }