Skip to main content
AgaGioUmpiSrl
Associate II
May 12, 2023
Solved

Add new locale to image

  • May 12, 2023
  • 2 replies
  • 2009 views

I need to create an application that can handle text translations with gettext() in C code.

How to add localizations to the image to be generated?

I added these configurations in the build recipe:

ENABLE_BINARY_LOCALE_GENERATION = "1"

GLIBC_GENERATE_LOCALES = "en_US.UTF-8 it_IT.UTF-8 en_GB.UTF-8 ro_RO.UTF-8 es_CO.UTF-8 es_CL.UTF-8 pt_BR.UTF-8"

IMAGE_LINGUAS = "en_us it_it en_gb ro_ro es_co es_cl pt_br"

With the following errors:

ERROR: image-rel-1.0-r0 do_rootfs: Unable to install packages. Command 'openstlinux-5.10-dunfell-mp1-21-11-17/build/tmp-glibc/work/board-ostl-linux-gnueabi/image-rel/1.0-r0/recipe-sysroot-native/usr/bin/ apt-get install --force-yes --allow-unauthenticated --no-remove locale-base-en_us locale-base-it_it locale-base-en_gb locale-base-ro_ro locale-base-es_co locale-base-es_cl locale -base-pt_br' returned 100:

Reading package lists...

Building dependency tree...

E: Unable to locate package locale-base-en_us

E: Unable to locate package locale-base-it_it

E: Unable to locate package locale-base-en_gb

E: Unable to locate package locale-base-ro_ro

E: Unable to locate package locale-base-es_co

E: Unable to locate package locale-base-es_cl

E: Unable to locate package locale-base-pt_br

Could you tell me the correct procedure to add the necessary localizations?

This topic has been closed for replies.
Best answer by Jean-Marc B

Hi @AgaGioUmpiSrl​ 

I am not sure but I think there could be a typo in the line:

IMAGE_LINGUAS = "en_us it_it en_gb ro_ro es_co es_cl pt_br"

Could you make a new attempt by replacing it with the following line:

IMAGE_LINGUAS = "en-us it-it en-gb ro-ro es-co es-cl pt-br"

Original characters «_» have been replaced by «-».

Best regards,

--JM

2 replies

Jean-Marc B
Jean-Marc BBest answer
ST Employee
May 23, 2023

Hi @AgaGioUmpiSrl​ 

I am not sure but I think there could be a typo in the line:

IMAGE_LINGUAS = "en_us it_it en_gb ro_ro es_co es_cl pt_br"

Could you make a new attempt by replacing it with the following line:

IMAGE_LINGUAS = "en-us it-it en-gb ro-ro es-co es-cl pt-br"

Original characters «_» have been replaced by «-».

Best regards,

--JM

AgaGioUmpiSrl
Associate II
May 24, 2023

Thanks Jean-Marc, that's how it works!