Some more changes...

This commit is contained in:
Carles Pina i Estany 2009-11-22 18:58:19 +00:00
parent 3014405923
commit b6c871b0d7
2 changed files with 22 additions and 5 deletions

View file

@ -184,7 +184,7 @@ grub_mofile_open (const char *filename)
if (!fd_mo) if (!fd_mo)
{ {
grub_dprintf ("gettext", "Cannot read %s", filename); grub_dprintf ("gettext", "Cannot read %s\n", filename);
return 0; return 0;
} }
@ -204,7 +204,7 @@ grub_mofile_open (const char *filename)
if (version != 0) if (version != 0)
{ {
grub_error (GRUB_ERR_BAD_FILE_TYPE, grub_error (GRUB_ERR_BAD_FILE_TYPE,
"mo: invalid mo version in file: %s", filename); "mo: invalid mo version in file: %s\n", filename);
fd_mo = 0; fd_mo = 0;
return 0; return 0;
} }
@ -267,6 +267,19 @@ grub_gettext_env_write_lang (struct grub_env_var *var
return grub_strdup (val); return grub_strdup (val);
} }
static grub_err_t
grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)
{
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "text to translate required");
const char *translation;
translation = grub_gettext_translate (args[0]);
grub_printf ("%s\n", translation);
return 0;
}
GRUB_MOD_INIT (gettext) GRUB_MOD_INIT (gettext)
{ {
(void) mod; /* To stop warning. */ (void) mod; /* To stop warning. */
@ -277,6 +290,10 @@ GRUB_MOD_INIT (gettext)
grub_gettext_init_ext (lang); grub_gettext_init_ext (lang);
grub_register_command_p1 ("gettext", grub_cmd_translate,
"gettext STRING",
"Translates the string with the current settings.");
/* Reload .mo file information if lang changes. */ /* Reload .mo file information if lang changes. */
grub_register_variable_hook ("lang", NULL, grub_gettext_env_write_lang); grub_register_variable_hook ("lang", NULL, grub_gettext_env_write_lang);

View file

@ -63,7 +63,7 @@ msgstr ""
#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587 #: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587
#, c-format #, c-format
msgid "Try ``%s --help'' for more information.\n" msgid "Try ``%s --help'' for more information.\n"
msgstr "Proveu «%s --help» per a obtenir més informació.\n" msgstr "Proveu «%s --help» per a obtenir més informació.\n"
#: util/i386/pc/grub-mkimage.c:323 #: util/i386/pc/grub-mkimage.c:323
#, c-format #, c-format
@ -889,12 +889,12 @@ msgid ""
" Use the %C and %C keys to select which entry is highlighted.\n" " Use the %C and %C keys to select which entry is highlighted.\n"
msgstr "" msgstr ""
"\n" "\n"
" Utilitzeu les tecles %C i %C per a seleccionar l'entrada.\n" " Utilitzeu les tecles %C i %C per a seleccionar l'entrada ressaltada.\n"
#: normal/menu_text.c:270 #: normal/menu_text.c:270
#, c-format #, c-format
msgid " The highlighted entry will be booted automatically in %ds. " msgid " The highlighted entry will be booted automatically in %ds. "
msgstr " L' entrada seleccionada sera arrancada automaticament en %ds. " msgstr " L' entrada seleccionada arrencarà automàticament en %ds. "
#: util/grub.d/10_kfreebsd.in:40 #: util/grub.d/10_kfreebsd.in:40
msgid "%s, with kFreeBSD %s" msgid "%s, with kFreeBSD %s"