How to (easily) be able to use a new en_** locale?

I want to use an en_IL.UTF-8 locale – but I can’t locale-gen it. I can choose this value in /etc/default/locale but that’s apparently not enough for all apps. It seems like I need to get locale-gen to generate some files for en_IL.UTF-8 … How do I do that? And what else do I need to setup?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Generating a locale requires two files, a locale definition and a character map. In your case you’ll need to create the former; you can probably adapt en_GB and he_IL to produce your own en_IL matching your requirements. The latter will just be the standard UTF-8.

Once you have both files, run localedef to compile the locale; something like

mkdir en_IL.utf8
localedef -f UTF-8 -i en_IL en_IL.utf8/

That should produce LC_ADDRESS, LC_COLLATE etc. in the en_IL.utf8 folder. You should copy that folder to /usr/local/lib/locale, so it ends up as /usr/local/lib/locale/en_IL.utf8. Once that’s done,

LANG=en_IL.UTF-8 locale

should produce the expected output, and you can use your new locale.

Depending on your exact distribution you may need to add en_IL.UTF-8 to /usr/local/share/i18n/SUPPORTED, or perhaps copy the folder to /usr/lib/locale instead of /usr/local/lib/locale.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply