Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Partial localization of Grub2

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
Schoelje
Posts: 9
Joined: 2012-07-20 22:42
Location: Netherlands

Partial localization of Grub2

#1 Post by Schoelje »

I wanted to localize Grub2 manually and did the following:
  • Code: Select all

    dpkg-reconfigure locales
    and selected nl_NL.UTF-8
  • I then checked these files for correctness:
    /etc/default/locale
    /etc/locale.gen
  • I copied all grub.mo files with:

    Code: Select all

            for F in $(find /usr/share/locale -name "grub.mo"); do 
                MO="/boot/grub/locale/$(echo $F | cut -d'/' -f 5).mo"
                if [ ! -e $MO ]; then
                    cp -v $F $MO
                fi
            done
  • I checked the .mo files in /boot/grub/locale
  • I added this to /etc/default/grub

    Code: Select all

    LANG=nl_NL
    LANGUAGE=nl_NL
  • Code: Select all

    sudo update-grub
I rebooted and saw that grub was only partially translated: the menu at the bottom was translated, however the kernel menu items were still in English.

It looks like /etc/grub.d/10_linux is missing something or did I miss something?
Founder of SolydXK

User avatar
Schoelje
Posts: 9
Joined: 2012-07-20 22:42
Location: Netherlands

Re: Partial localization of Grub2

#2 Post by Schoelje »

I think I found the solution:

Use

Code: Select all

GRUB_LANG=nl_NL
instead of

Code: Select all

LANG=nl_NL
in /etc/default/grub
Founder of SolydXK

User avatar
Schoelje
Posts: 9
Joined: 2012-07-20 22:42
Location: Netherlands

Re: Partial localization of Grub2

#3 Post by Schoelje »

No, that wasn't it.

It happened when installing a new system from a live session. A chroot environment contains the newly installed system where things are configured according to the user's settings.

Running

Code: Select all

chroot /chrootdir update-grub
would not set the default language set in the chroot environment in grub.cfg. That's because LANG is passed from the host to the chroot environment which is en_US thus writing lang = en_US in grub.cfg.

By running

Code: Select all

LANG=nl_NL.UTF-8 chroot /chrootdir update-grub
LANG is set for only this chroot command and lang = nl_NL is written to grub.cfg.

There is no need to edit /etc/default/grub
Founder of SolydXK

Post Reply