]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/gettext/gettext.c: Try $lang.gmo as well.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 4 May 2013 11:40:52 +0000 (13:40 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 4 May 2013 11:40:52 +0000 (13:40 +0200)
ChangeLog
grub-core/gettext/gettext.c

index 7a7d11c308edad3ca9f90241536f0e7ad08f9a8b..e0576e57b0b5445a5b8497ed13ed1e899368f2b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        Fix test -a and -o precedence.
index 569f985320c41fa5e12a2ca9242caa589d9a7f68..259251d7631713312b6defaabee310cfb3dbbf4b 100644 (file)
@@ -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;
 }