From 35fb59a50ca2de628c01e44fcb7c56009b939bee Mon Sep 17 00:00:00 2001 From: Hans van Kranenburg Date: Wed, 20 Dec 2017 11:38:14 +0100 Subject: [PATCH] grub.d/xen.cfg: fix default entry when using l10n When a user uses a locale that results in translating menu item titles into another language than English, the hardcoded "Debian GNU/Linux, with Xen hypervisor" would not match anything. So, use gettext to make it match the right translated entry. Also see - https://bugs.launchpad.net/ubuntu/+source/xen/+bug/1321144 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865086 Note that (thanks Ian for the info): * When GRUB_TERMINAL is not empty and set to anything other than `gfxterm', grub will not do translation at all, because grub-mkconfig thinks that other GRUB_TERMINAL values including `serial' preclude non-ASCII characters, and that causes it to set LANG=C. (I have GRUB_TERMINAL="serial console", which caused much confusion when trying to test all of this). * Just trying the printf "$(gettext... below is not enough to test if a translation shows up. It needs -d grub additionally for gettext, or TEXTDOMAIN=grub in the environment, which is probably present when this file gets run by update-grub. Signed-off-by: Hans van Kranenburg --- debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg b/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg index b2d2f6ee93..c16e657067 100644 --- a/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg +++ b/debian/tree/xen-hypervisor-common/etc/default/grub.d/xen.cfg @@ -50,5 +50,7 @@ if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "" ]; then XEN_OVERRIDE_GRUB_DEFAULT=1 fi if [ "$XEN_OVERRIDE_GRUB_DEFAULT" = "1" ]; then - GRUB_DEFAULT="Debian GNU/Linux, with Xen hypervisor" + GRUB_DEFAULT=$( \ + printf "$(gettext "%s, with Xen hypervisor")" \ + "$GRUB_DISTRIBUTOR GNU/Linux") fi -- 2.30.2