16.1. Listing Available Locales
Problem
You want to know what locales your system supports.
Solution
Use the locale program to list available locales; locale -a prints the locales your system supports.
Discussion
On
Linux and Solaris systems, you
can find locale at
/usr/bin/locale. On Windows, locales are listed in the
Regional Options section of the Control Panel.
Your mileage varies on other operating systems. BSD, for example, includes locale support but has no locale program to list locales. BSD locales are often stored in /usr/share/locale, so looking in that directory may yield a list of usable locales.
While the locale system helps with many localization tasks, its lack of standardization can be frustrating. Systems aren’t guaranteed to have the same locales or even use the same names for equivalent locales.
See Also
Your system’s locale(1) manpage.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access