Linux.com

Author Message
Joined: May 12, 2008
Posts: 8
Other Topics
Posted May 16, 2008 at 4:03:39 PM
Subject: Displaying the locales in plain english

Hi,

I am developing a program that would ask the user to set the locale.

For that, I need to display them to user in plain english.

like

English(US)
English (Uk)

depending on the user selection I need to set the locale.

Is there a command in redhat linux that would display locales in more friendly mamner rather than like this "en-US.UTF-8"

Thanks,
sunny.

Back to top Profile Email Website
Anthony Robbins

Joined May 06, 2008
Posts: 22

Other Topics
Posted: May 16, 2008 6:16:46 PM
Subject: Displaying the locales in plain english

Unfortunately this is ambiquous since "en-US.UTF-8" also sets the encoding,
so it would be English (US) UTF-8
/usr/share/locale/locale.alias and /usr/share/i18n/locales should have everything you need, eg:

# grep -i title /usr/share/i18n/locales/*
/usr/share/i18n/locales/aa_DJ:title "Afar language locale for Djibouti (Cadu/Laaqo Dialects)."
/usr/share/i18n/locales/aa_ER:title "Afar language locale for Eritrea (Cadu/Laaqo Dialects)."
/usr/share/i18n/locales/aa_ER@saaho:title "Afar language locale for Eritrea (Saaho Dialect)."
/usr/share/i18n/locales/aa_ET:title "Afar language locale for Ethiopia (Cadu/Carra Dialects)."
/usr/share/i18n/locales/af_ZA:title "Afrikaans locale for South Africa"
/usr/share/i18n/locales/am_ET:title "Amharic language locale for Ethiopia."
/usr/share/i18n/locales/an_ES:title "Aragonese locale for Spain"
/usr/share/i18n/locales/ar_AE:title "Arabic language locale for United Arab Emirates"
/usr/share/i18n/locales/ar_BH:title "Arabic language locale for Bahrain"

Back to top Profile Email Website
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya