Partial localization of Grub2

Kernels & Hardware, configuring network, installing services

Partial localization of Grub2

Postby Schoelje » 2017-07-17 07:05

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

Postby Schoelje » 2017-07-17 11:29

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

Postby Schoelje » 2017-07-19 10:35

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
User avatar
Schoelje
 
Posts: 9
Joined: 2012-07-20 22:42
Location: Netherlands


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable