如何为Yocto版本添加多语言支持? [英] How to add multilanguage support to a Yocto build?
问题描述
我正在尝试为Yocto版本添加多语言支持.阅读官方文档后,我发现控制语言环境设置的构建选项为:
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
链接: 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"
如果我要求"localectl"可用语言环境列表,则不会显示任何内容(命令:localectl list-locales).
if I ask to "localectl" the list of available locales, nothing is displayed (command: localectl list-locales).
另外一点信息,"locale"命令的输出为:
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=
"locale -a"命令的输出为:
The output of "locale -a" command is:
C
POSIX
我想念什么?
推荐答案
未生成语言环境,因为IMAGE_LINGUAS变量被覆盖到另一个地方(我的错).
The locales were not generated because the IMAGE_LINGUAS variable was overwritten into another place (my fault).
使用IMAGE_LINGUAS生成的语言环境,例如"en_GB"或"en_US"的名称中没有后缀".UTF-8",但它们使用UTF-8编码.要检查语言环境是否为UTF-8,请参阅: https://stackoverflow.com/a/42797421/5321161
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
这篇关于如何为Yocto版本添加多语言支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!