From 0788a69514a2f2d19c0f8b9bd1b1835b589cbb20 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 4 May 2013 13:40:52 +0200 Subject: [PATCH] * grub-core/gettext/gettext.c: Try $lang.gmo as well. --- ChangeLog | 4 ++++ grub-core/gettext/gettext.c | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a7d11c30..e0576e57b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-05-04 Vladimir Serbinenko + + * grub-core/gettext/gettext.c: Try $lang.gmo as well. + 2013-05-04 Vladimir Serbinenko Fix test -a and -o precedence. diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c index 569f98532..259251d76 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -355,19 +355,30 @@ grub_mofile_open_lang (struct grub_gettext_context *ctx, return grub_errno; err = grub_mofile_open (ctx, mo_file); + grub_free (mo_file); /* Will try adding .gz as well. */ if (err) { - char *mo_file_old; grub_errno = GRUB_ERR_NONE; - mo_file_old = mo_file; - mo_file = grub_xasprintf ("%s.gz", mo_file); - grub_free (mo_file_old); + mo_file = grub_xasprintf ("%s%s/%s.mo.gz", part1, part2, locale); if (!mo_file) return grub_errno; 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; }