Bug 11139

Summary: Locale settings does not have effects
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yocto User <yoctouser>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: High CC: costamagnagianfranco, meta.mr.watcher, meta.watcher
Version: 2.2.1   
Target Milestone: 2.3 M4   
Hardware: Other   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yocto User 2017-03-09 12:04:31 UTC
Preconditions/Environment
-------------------------
Host system: Ubuntu 14.04.5 LTS (Trusty Tahr)
Yocto version: YP Core - Morty 2.2.1
Target: SABRE Board for Smart Devices based on i.MX 6Quad processor
Additional meta: meta-freescale, meta-freescale-3rdparty, meta-freescale-distro

Triggering Action/Cause
-----------------------
Modified the local.conf to specify the desired locales with the add of the following variable:
IMAGE_LINGUAS = "de-de fr-fr en-gb"

Built a base image with the command:
bitbake core-image-base

Booted the image into the SABRE board

Expectation
-----------
The filesystem contains the desired locales into the path:
/usr/share/locale

The generated locales do support UTF-8 encoding

The output of the command:
LANG=fr_FR df | head -n1

is translated in french.

Actual Result
-------------
The filesystem contains the desired locales:
root@imx6qsabresd:~# ls -la /usr/share/locale/
drwxr-xr-x    5 root     root          1024 Mar  8 10:34 .
drwxr-xr-x   13 root     root          1024 Mar  8 10:34 ..
drwxr-xr-x    3 root     root          1024 Mar  8 10:34 de
drwxr-xr-x    3 root     root          1024 Mar  8 10:34 en_GB
drwxr-xr-x    3 root     root          1024 Mar  8 10:45 fr

The output of the commands:
root@imx6qsabresd:~# LANG=fr_FR df | head -n1
Filesystem           1K-blocks      Used Available Use% Mounted on

root@imx6qsabresd:~# LANG=fr df | head -n1
Filesystem           1K-blocks      Used Available Use% Mounted on

is in english. No french translation.

Reproducibility
---------------
Always
Comment 1 Ross Burton 2017-03-09 17:19:26 UTC
Update: df is a bad choice as busybox doesn't support locales.
Comment 2 Ross Burton 2017-03-09 17:53:34 UTC
root@bob:/usr/lib/locale/fr_FR# LANG=fr_FR sed --help
Utilisation: sed [OPTION]... {script-seulement-si-pas-d'autre-script}

It's not totally broken, just need to make sure you don't use a busybox binary as that doesn't support translations.
Comment 3 Yocto User 2017-03-10 08:34:21 UTC
Not a bug, the problem was caused by the fact that the "df" tool from BusyBox v1.24.1 does not support translations. When checking locales be sure to use a binary that supports them.