From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1TCsxs-0002zN-6f for mharc-grub-devel@gnu.org; Sat, 15 Sep 2012 10:03:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCsxq-0002yU-4q for Grub-devel@gnu.org; Sat, 15 Sep 2012 10:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCsxp-0000IQ-72 for Grub-devel@gnu.org; Sat, 15 Sep 2012 10:03:18 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:56467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCsxo-0000Ht-W9 for Grub-devel@gnu.org; Sat, 15 Sep 2012 10:03:17 -0400 Received: by lbon3 with SMTP id n3so3559515lbo.0 for ; Sat, 15 Sep 2012 07:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:content-type:x-mailer:mime-version :content-transfer-encoding; bh=rao1QN9oAzp/dmFbQSd/fqTeROuhqaNt4eiN68VSLJg=; b=cLxI/AEeMqZ+RxXWTubjuFZUFNzV/CX52q037TTy9BoE9NbhNzbbkph83FDXa+dtUp smTdEKx0YwHjLEZ00TPBtwsaU2G0FsCWa8cUY9tUb1G/yIduvtnftcLVeYKL+WfurqPU 9zvMATI/ecp4jGIwH+uqDTMNcDe5ERfv1esegBtB5TTq9VOECFSnfk8DQRusibde5m/t hoTb6u11lvcfXQMQ2c/mR3iJ1MoCVMuI9vZptg3QZMenP+2vxGZPPQ3EljJPRYIIEurv dnvXYTtHKZ87ZhuZ1yqYM34DD0wKd7d/WN7Ptt0TNiW5/dcFCG4Sfh6U7P+k4wbVu57d sq6w== Received: by 10.152.144.67 with SMTP id sk3mr40683lab.19.1347717795475; Sat, 15 Sep 2012 07:03:15 -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 d1sm1228131lbk.16.2012.09.15.07.03.13 (version=SSLv3 cipher=OTHER); Sat, 15 Sep 2012 07:03:14 -0700 (PDT) Message-ID: <1347717791.11900.15.camel@opensuse.site> Subject: grub-mkconfig locale vs. boot-time grub locale From: Andrey Borzenkov To: Grub-devel@gnu.org Date: Sat, 15 Sep 2012 18:03:11 +0400 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.217.169 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 14:03:19 -0000 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? -andrey