Recipe 19.1. Listing Available Locales


19.1.1. Problem

You want to know what locales your system supports.

19.1.2. Solution

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

19.1.3. Discussion

On Linux and Solaris systems, you can find locale at /usr/bin/locale. On Windows XP, locales are listed in the "Standards and Formats" drop-down menu in the "Regional Options" tab of the "Regional and Language 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.

19.1.4. See Also

Your system's locale(1) manpage. A list of language strings that Windows understands as locale names is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asphttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp. A list of country/region strings that Windows understands as locale names is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp.




PHP Cookbook, 2nd Edition
PHP Cookbook: Solutions and Examples for PHP Programmers
ISBN: 0596101015
EAN: 2147483647
Year: 2006
Pages: 445

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net