Bug#610910: grub-pc: LC_MESSAGES env value is not used

2015-03-31 Thread Ralf Jung
Dear grub Maintainers,

four years after being reported (with a patch!), this bug is still open.
I would appreciate if you could kindly review the provided patch, which
looks like a simple enough fix to make grub follow common practice on
Linux wrt. the locale (in particular, LC_MESSAGES overriding LANG for,
well, messages).

Kind regards,
Ralf


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#610910: grub-pc: LC_MESSAGES env value is not used

2011-01-23 Thread Andreas Sundstrom
Package: grub-pc
Version: 1.98+20100804-13
Severity: minor
Tags: patch l10n

grub.cfg takes it lang setting from the LANG variable even if an
overriding value has been set with LC_MESSAGES.
People like me that want's the system to talk english but handle
swedish dates etc. may use settings like this:
$ cat /etc/default/locale
LANG=sv_SE.UTF-8
LC_MESSAGES=en_US.UTF-8

Currently update-grub will set lang to 'sv' instead of 'en' in this
case.
In my opinion grub should use the same language as other commands in
the same installation.

I have attached a patch that I use to change the behavior.

/Andreas

-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]   1.5.36   Debian configuration management sy
ii  grub-common 1.98+20100804-13 GRand Unified Bootloader, version 
ii  libc6   2.11.2-9 Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1  2:1.02.48-4  The Linux Kernel Device Mapper use
ii  ucf 3.0025+nmu1  Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
pn  desktop-base  none (no description available)

-- debconf information:
  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub2/linux_cmdline:
  grub-pc/install_devices_empty: false
  grub-pc/install_devices_failed: false
* grub-pc/chainload_from_menu.lst: true
  grub-pc/kopt_extracted: true
* grub-pc/install_devices: /dev/disk/by-id/ata-IC25N020ATDA04-0_63A630B8868
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
  grub2/linux_cmdline_default: quiet
  grub-pc/mixed_legacy_and_grub2: true
--- etc/grub.d/00_header~   2011-01-04 15:33:02.0 +0100
+++ etc/grub.d/00_header2011-01-23 22:13:52.0 +0100
@@ -23,7 +23,11 @@
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib
 locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}`
-grub_lang=`echo $LANG | cut -d _ -f 1`
+if [ ! -z $LC_MESSAGES ]; then
+grub_lang=`echo $LC_MESSAGES | cut -d _ -f 1`
+else
+grub_lang=`echo $LANG | cut -d _ -f 1`
+fi
 
 . ${libdir}/grub/grub-mkconfig_lib
 
@@ -206,7 +210,7 @@
 fi
 
 # Gettext variables and module
-if [ x${LANG} != xC ]  [ -d ${locale_dir} ] ; then
+if [ x${grub_lang} != xC ]  [ -d ${locale_dir} ] ; then
 prepare_grub_to_access_device $(${grub_probe} --target=device 
${locale_dir})
   cat  EOF
 set locale_dir=(\$root)$(make_system_path_relative_to_its_root ${locale_dir})