All of lore.kernel.org
 help / color / mirror / Atom feed
* grub-mkconfig locale vs. boot-time grub locale
@ 2012-09-15 14:03 Andrey Borzenkov
  2012-09-15 15:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2012-09-15 14:03 UTC (permalink / raw)
  To: Grub-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grub-mkconfig locale vs. boot-time grub locale
  2012-09-15 14:03 grub-mkconfig locale vs. boot-time grub locale Andrey Borzenkov
@ 2012-09-15 15:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-09-15 17:38   ` Andrey Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-09-15 15:48 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

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.

> -andrey
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grub-mkconfig locale vs. boot-time grub locale
  2012-09-15 15:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-09-15 17:38   ` Andrey Borzenkov
  2012-09-18  8:21     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2012-09-15 17:38 UTC (permalink / raw)
  To: The development of GNU GRUB

В Сб., 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grub-mkconfig locale vs. boot-time grub locale
  2012-09-15 17:38   ` Andrey Borzenkov
@ 2012-09-18  8:21     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-09-18  8:21 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2281 bytes --]

On 15.09.2012 19:38, Andrey Borzenkov wrote:

> В Сб., 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.
> 

Currently GRUB has no way of having separate locale for a part of it. It
would need additional work since currently some parts of text are
translated at grub-mkconfig time. I'm not sure how necessary it is to
have more fine-grained model.

> -andrey
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-18  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15 14:03 grub-mkconfig locale vs. boot-time grub locale Andrey Borzenkov
2012-09-15 15:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-09-15 17:38   ` Andrey Borzenkov
2012-09-18  8:21     ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.