* grub-core/gettext/gettext.c: Try $lang.gmo as well.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-05-04 13:40:52 +02:00
parent daf01d61ff
commit 0788a69514
2 changed files with 19 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gettext/gettext.c: Try $lang.gmo as well.
2013-05-04 Vladimir Serbinenko <phcoder@gmail.com> 2013-05-04 Vladimir Serbinenko <phcoder@gmail.com>
Fix test -a and -o precedence. Fix test -a and -o precedence.

View file

@ -355,19 +355,30 @@ grub_mofile_open_lang (struct grub_gettext_context *ctx,
return grub_errno; return grub_errno;
err = grub_mofile_open (ctx, mo_file); err = grub_mofile_open (ctx, mo_file);
grub_free (mo_file);
/* Will try adding .gz as well. */ /* Will try adding .gz as well. */
if (err) if (err)
{ {
char *mo_file_old;
grub_errno = GRUB_ERR_NONE; grub_errno = GRUB_ERR_NONE;
mo_file_old = mo_file; mo_file = grub_xasprintf ("%s%s/%s.mo.gz", part1, part2, locale);
mo_file = grub_xasprintf ("%s.gz", mo_file);
grub_free (mo_file_old);
if (!mo_file) if (!mo_file)
return grub_errno; return grub_errno;
err = grub_mofile_open (ctx, mo_file); err = grub_mofile_open (ctx, mo_file);
grub_free (mo_file);
} }
/* Will try adding .gmo as well. */
if (err)
{
grub_errno = GRUB_ERR_NONE;
mo_file = grub_xasprintf ("%s%s/%s.gmo", part1, part2, locale);
if (!mo_file)
return grub_errno;
err = grub_mofile_open (ctx, mo_file);
grub_free (mo_file);
}
return err; return err;
} }