2009-12-25 Carles Pina i Estany <carles@pina.cat>
* commands/help.c: Include `<grub/i18n.h>'. (grub_cmd_help): Gettextizze. (GRUB_MOD_INIT): Likewise. * commands/i386/pc/play.c: Include `<grub/i18n.h>'. (GRUB_MOD_INIT): Gettextizze. * commands/search.c: Include `<grub/i18n.h>'. (options): Gettextizze. (GRUB_MOD_INIT): Gettextizze. * lib/arg.c: Include `<grub/i18n.h>'. (help_options): Gettextizze. (find_long): Likewise. (grub_arg_show_help): Likewise. * normal/dyncmd.c: Include `<grub/i18n.h>'. (read_command_list): Gettextizze. * po/POTFILES: Add `commands/i386/pc/play.c', `commands/search.c', `commands/help.c', `lib/arg.c' and `normal/dyncmd.c'.
This commit is contained in:
parent
2281552630
commit
ec5f98abda
7 changed files with 53 additions and 21 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
|
||||
|
@ -38,13 +39,14 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
|
|||
(cmd->flags & GRUB_COMMAND_FLAG_CMDLINE))
|
||||
{
|
||||
char description[GRUB_TERM_WIDTH / 2];
|
||||
int desclen = grub_strlen (cmd->summary);
|
||||
const char* summary_translated = _(cmd->summary);
|
||||
int desclen = grub_strlen (summary_translated);
|
||||
|
||||
/* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled
|
||||
with the description followed by spaces. */
|
||||
grub_memset (description, ' ', GRUB_TERM_WIDTH / 2 - 1);
|
||||
description[GRUB_TERM_WIDTH / 2 - 1] = '\0';
|
||||
grub_memcpy (description, cmd->summary,
|
||||
grub_memcpy (description, summary_translated,
|
||||
(desclen < GRUB_TERM_WIDTH / 2 - 1
|
||||
? desclen : GRUB_TERM_WIDTH / 2 - 1));
|
||||
|
||||
|
@ -65,8 +67,8 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
|
|||
if (cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)
|
||||
grub_arg_show_help ((grub_extcmd_t) cmd->data);
|
||||
else
|
||||
grub_printf ("Usage: %s\n%s\b", cmd->summary,
|
||||
cmd->description);
|
||||
grub_printf ("%s %s\n%s\b", _("Usage:"), _(cmd->summary),
|
||||
_(cmd->description));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -94,8 +96,8 @@ GRUB_MOD_INIT(help)
|
|||
{
|
||||
cmd = grub_register_extcmd ("help", grub_cmd_help,
|
||||
GRUB_COMMAND_FLAG_CMDLINE,
|
||||
"help [PATTERN ...]",
|
||||
"Show a help message.", 0);
|
||||
N_("help [PATTERN ...]"),
|
||||
N_("Show a help message."), 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(help)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue