简体   繁体   中英

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?

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

The locales generated with IMAGE_LINGUAS, eg "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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM