From b6c871b0d7879f1848d70ebde302e453a6ca50a2 Mon Sep 17 00:00:00 2001 From: Carles Pina i Estany Date: Sun, 22 Nov 2009 18:58:19 +0000 Subject: [PATCH] Some more changes... --- gettext/gettext.c | 21 +++++++++++++++++++-- po/ca.po | 6 +++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/gettext/gettext.c b/gettext/gettext.c index 355bb75a0..46ceb3432 100644 --- a/gettext/gettext.c +++ b/gettext/gettext.c @@ -184,7 +184,7 @@ grub_mofile_open (const char *filename) if (!fd_mo) { - grub_dprintf ("gettext", "Cannot read %s", filename); + grub_dprintf ("gettext", "Cannot read %s\n", filename); return 0; } @@ -204,7 +204,7 @@ grub_mofile_open (const char *filename) if (version != 0) { 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; return 0; } @@ -267,6 +267,19 @@ grub_gettext_env_write_lang (struct grub_env_var *var 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) { (void) mod; /* To stop warning. */ @@ -277,6 +290,10 @@ GRUB_MOD_INIT (gettext) 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. */ grub_register_variable_hook ("lang", NULL, grub_gettext_env_write_lang); diff --git a/po/ca.po b/po/ca.po index e0e6e4d06..12d57b0af 100644 --- a/po/ca.po +++ b/po/ca.po @@ -63,7 +63,7 @@ msgstr "" #: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587 #, c-format 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 #, c-format @@ -889,12 +889,12 @@ msgid "" " Use the %C and %C keys to select which entry is highlighted.\n" msgstr "" "\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 #, c-format 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 msgid "%s, with kFreeBSD %s"