From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1TCwKL-0000l9-RP for mharc-grub-devel@gnu.org; Sat, 15 Sep 2012 13:38:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCwKI-0000iK-LG for grub-devel@gnu.org; Sat, 15 Sep 2012 13:38:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCwKH-0002Gi-MJ for grub-devel@gnu.org; Sat, 15 Sep 2012 13:38:42 -0400 Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:47289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCwKH-0002Ga-EQ for grub-devel@gnu.org; Sat, 15 Sep 2012 13:38:41 -0400 Received: by lahd3 with SMTP id d3so3586834lah.0 for ; Sat, 15 Sep 2012 10:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:content-type :x-mailer:mime-version:content-transfer-encoding; bh=IpA/VYAZcq7Z3AqN3w6MMQKZ1JtvhllbNqQY3xX06Us=; b=cpah/ORC2KCLO8abXAcOLwQT4ww576Q/BlA4iRYRPmQj2o5Kq0Bzc8M5A86Hfc5ElO aT13qPvqBrbyv1LRqLfTbDHLoG/5KkAyjVIo/KJWvpcBLp1Rtql5ldq1SSHAnCLeJ2sb i5fGAojLoTa6Td28MX+eKmOWfLdibpJV7kfQzLRsCwQesEXwR8rwRdGAmk0VR9DYat+Y FPecPnEbNYBeQk0OoqX3yjG5DZKnO+BHYbbbEaytClhYOALGo5TRiU2kyBWBha6K6Cj4 kSeXt98xQoltL/CZpBl9amwT0TJtmpH+84njScOUwUteWGLk2r4FaFu+lASFPidUMjnu poeA== Received: by 10.112.48.193 with SMTP id o1mr2390828lbn.62.1347730720235; Sat, 15 Sep 2012 10:38:40 -0700 (PDT) Received: from [192.168.10.142] (ppp83-237-3-242.pppoe.mtu-net.ru. [83.237.3.242]) by mx.google.com with ESMTPS id hh10sm1471311lab.10.2012.09.15.10.38.37 (version=SSLv3 cipher=OTHER); Sat, 15 Sep 2012 10:38:39 -0700 (PDT) Message-ID: <1347730716.1660.7.camel@opensuse.site> Subject: Re: grub-mkconfig locale vs. boot-time grub locale From: Andrey Borzenkov To: The development of GNU GRUB Date: Sat, 15 Sep 2012 21:38:36 +0400 In-Reply-To: <5054A352.1070808@gmail.com> References: <1347717791.11900.15.camel@opensuse.site> <5054A352.1070808@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 17:38:43 -0000 В Сб., 15/09/2012 в 17:48 +0200, Vladimir 'φ-coder/phcoder' Serbinenko пишет: > On 15.09.2012 16:03, Andrey Borzenkov wrote: > > > Currently grub-mkconfig is using current (at the time of invocation) > > locale to > > > > 1. output status messages during invocation > > 2. put translated messages (verbatim) into generated grub.cfg > > 3. set language in grub.cfg (set lang) > > > > The problem is, user locale at the time of invocation does not > > necessarily correspond to default system locale. This becomes even more > > extreme as SSH and su/sudo often pass through locale environment > > variables by default; so user locale may be inherited from unpredictable > > value set on remote system. > > > > Now imagine Chinese customer support employee remotely invoking > > grub-mkconfig for European customer ... > > > > It seems that case 1 and 2/3 should be treated differently. Suggestion > > is > > > > - export GRUB_LANG in grub-mkconfig for use in /etc/grub.d scripts. > > GRUB_LANG is supposed to be set to system wide default. This may be set > > by distributions in /etc/default/grub when system locale is changed or > > determined dynamically from existing configuration. > > > > - provide convenience wrapper for scripts in /etc/grub.d which basically > > does LC_MESSAGES=$GRUB_LANG gettext ... > > > > Does it sound sensible? > > > > Just set LC_ALL/LC_MESSAGES in /etc/default/grub. I don't see a reason > to have a separate variable for this in etc/default/grub if you can just > set standard ones there. > The primary reason to separate them is to let grub-mkconfig to emit messages in user's native locale. Which is not necessarily the one set as default. -andrey