Silence error messages when translations are unavailable.

This commit is contained in:
Colin Watson 2012-09-06 11:54:14 +01:00
parent 92c042b6b3
commit fe65cbefd2
4 changed files with 35 additions and 0 deletions

1
debian/changelog vendored
View File

@ -38,6 +38,7 @@ grub2 (2.00-1) UNRELEASED; urgency=low
* Backport from upstream:
- Don't decrease efi_mmap_size (LP: #1046429).
* grub-common Suggests: console-setup for grub-kbdcomp (closes: #686815).
* Silence error messages when translations are unavailable.
-- Christian Perrier <bubulle@debian.org> Sat, 02 Jun 2012 19:51:35 +0200

25
debian/patches/gettext_quiet.patch vendored Normal file
View File

@ -0,0 +1,25 @@
Description: Silence error messages when translations are unavailable
Author: Colin Watson <cjwatson@ubuntu.com>
Bug: https://savannah.gnu.org/bugs/?35880
Forwarded: https://savannah.gnu.org/bugs/?35880
Last-Update: 2012-09-06
Index: b/grub-core/gettext/gettext.c
===================================================================
--- a/grub-core/gettext/gettext.c
+++ b/grub-core/gettext/gettext.c
@@ -412,6 +412,14 @@
grub_free (lang);
}
+
+ /* If no translations are available, fall back to untranslated text. */
+ if (err == GRUB_ERR_FILE_NOT_FOUND)
+ {
+ grub_errno = GRUB_ERR_NONE;
+ return 0;
+ }
+
return err;
}

View File

@ -14,3 +14,4 @@ mkconfig_loopback.patch
efi_disk_cache.patch
restore_mkdevicemap.patch
efi_mmap_size.patch
gettext_quiet.patch

View File

@ -412,6 +412,14 @@ grub_gettext_init_ext (struct grub_gettext_context *ctx,
grub_free (lang);
}
/* If no translations are available, fall back to untranslated text. */
if (err == GRUB_ERR_FILE_NOT_FOUND)
{
grub_errno = GRUB_ERR_NONE;
return 0;
}
return err;
}