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

* include/grub/auth.h: Include `<grub/i18n.h>'.
	(GRUB_GET_PASSWORD): Gettextizze string.
	* include/grub/normal.h (STANDARD_MARGIN): New macro, moved from
	menu_text.c.
	(grub_utf8_to_ucs4_alloc): Fix indentation.
	(grub_print_ucs4): Likewise.
	(grub_getstringwidth): Likewise.
	(print_message_indented): New declaration.
	* normal/auth.c: Include `<grub/i18n.h>'.
	(grub_auth_check_authentication): Gettexttize string.
	* normal/cmdline.c: Include `<grub/i18n.h>'.
	(grub_cmdline_get): Gettextizze.
	* normal/color.c: Include `<grub/i18n.h>'.
	(grub_parse_color_name_pair): Gettexttize strings.
	* normal/main.c (grub_normal_reader_init): Cleanup gettexttized
	string (use `print_message_indented').
	* normal/menu_text.c (STANDARD_MARGIN): Moved from here to
	`include/grub/normal.h'.
	(print_message_indented): Renamed to ...
	(grub_print_message_indented): ... this. Remove `static' qualifer (now
	used in normal/main.c).
	(print_message): Use `grub_print_message_indented' instead of
	`print_message_indented'.
	(print_timeout): Likewise.
	* normal/misc.c: Include `<grub/term.h>' and `<grub/i18n.h>'.
	(grub_normal_print_device_info): Gettexttize strings.
	* po/POTFILES: Add `auth.c', `color.c' and `misc.c'.
This commit is contained in:
carles 2009-12-20 23:32:15 +00:00
parent 3041d8989c
commit 7f39d92f8d
10 changed files with 95 additions and 36 deletions

View file

@ -31,8 +31,6 @@
entry failing to boot. */
#define DEFAULT_ENTRY_ERROR_DELAY_MS 2500
#define STANDARD_MARGIN 6
static grub_uint8_t grub_color_menu_normal;
static grub_uint8_t grub_color_menu_highlight;
@ -106,8 +104,8 @@ grub_getstringwidth (grub_uint32_t * str, const grub_uint32_t * last_position)
return width;
}
static void
print_message_indented (const char *msg, int margin_left, int margin_right)
void
grub_print_message_indented (const char *msg, int margin_left, int margin_right)
{
int line_len;
line_len = GRUB_TERM_WIDTH - grub_getcharwidth ('m') *
@ -206,7 +204,7 @@ print_message (int nested, int edit)
if (edit)
{
grub_putchar ('\n');
print_message_indented (_("Minimum Emacs-like screen editing is \
grub_print_message_indented (_("Minimum Emacs-like screen editing is \
supported. TAB lists completions. Press Ctrl-x to boot, Ctrl-c for a \
command-line or ESC to return menu."), STANDARD_MARGIN, STANDARD_MARGIN);
}
@ -220,11 +218,11 @@ entry is highlighted.\n");
grub_sprintf (msg_translated, msg, (grub_uint32_t) GRUB_TERM_DISP_UP,
(grub_uint32_t) GRUB_TERM_DISP_DOWN);
grub_putchar ('\n');
print_message_indented (msg_translated, STANDARD_MARGIN, STANDARD_MARGIN);
grub_print_message_indented (msg_translated, STANDARD_MARGIN, STANDARD_MARGIN);
grub_free (msg_translated);
print_message_indented (_("Press enter to boot the selected OS, \
grub_print_message_indented (_("Press enter to boot the selected OS, \
\'e\' to edit the commands before booting or \'c\' for a command-line.\n"), STANDARD_MARGIN, STANDARD_MARGIN);
if (nested)
@ -403,7 +401,7 @@ print_timeout (int timeout, int offset)
grub_malloc (sizeof (char) * grub_strlen (msg) + 5);
grub_sprintf (msg_translated, msg, timeout);
print_message_indented (msg_translated, 3, 0);
grub_print_message_indented (msg_translated, 3, 0);
int posx;
posx = grub_getxy() >> 8;