Book HomePHP CookbookSearch this book

16.2. Listing Available Locales

16.2.1. Problem

You want to know what locales your system supports.

16.2.2. Solution

Use the locale program to list available locales; locale -a prints the locales your system supports.

16.2.3. 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.

16.2.4. See Also

Your system's locale(1) manpage.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.