Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add multilanguage support to a Yocto build?

I'm trying to add multilanguage support to a Yocto build. Reading the official documentation I've found that the build options that controls locale settings are:

  • GLIBC_GENERATE_LOCALES
  • IMAGE_LINGUAS

Link: http://www.yoctoproject.org/docs/1.8/mega-manual/mega-manual.html#var-GLIBC_GENERATE_LOCALES

After a build with the following options:

GLIBC_GENERATE_LOCALES="en_GB.UTF-8 en_US.UTF-8"
IMAGE_LINGUAS?="en-gb"

if I ask to "localectl" the list of available locales, nothing is displayed (command: localectl list-locales).

Another bit of info, the output of the "locale" command is:

LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

The output of "locale -a" command is:

C
POSIX

What am I missing?

like image 536
Grynium Avatar asked Sep 11 '25 17:09

Grynium


1 Answers

The locales were not generated because the IMAGE_LINGUAS variable was overwritten into another place (my fault).

The locales generated with IMAGE_LINGUAS, e.g. "en_GB" or "en_US", does not have the ".UTF-8" suffix in their name but they use the UTF-8 encoding. To check if a locale is UTF-8 refer to: https://stackoverflow.com/a/42797421/5321161

like image 135
Grynium Avatar answered Sep 13 '25 08:09

Grynium