8 FS::Locales - Supported locales
14 my @locales = FS::Locales->locales;
18 FS::Locales provides a list of supported locales.
26 Returns a list of the available locales.
30 tie our %locales, 'Tie::IxHash',
31 'en_US', { name => 'English', country => 'United States', },
32 'en_AU', { name => 'English', country => 'Australia', },
33 'en_CA', { name => 'English', country => 'Canada', },
34 'fr_CA', { name => 'French', country => 'Canada', },
35 'fr_FR', { name => 'French', country => 'France', },
36 'fr_HT', { name => 'French', country => 'Haiti', },
37 'ht_HT', { name => 'Haitian Creole', country => 'Haiti', },
38 'iw_IL', { name => 'Hebrew', country => 'Israel', rtl=>1, },
41 $_->{label} = $_->{name} . ' (' . $_->{country} . ')'
42 foreach values %locales;
48 =item locale_info LOCALE
50 Returns a hash of information about a locale.
55 my($class, $locale) = @_;
58 } elsif (exists $locales{$locale}) {
59 return %{ $locales{$locale} };
61 die "unsupported locale '$locale'\n";
65 =item description LOCALE
67 Returns "Language (Country)" for a locale.
72 my($class, $locale) = @_;
73 $locales{$locale}->{'name'} . ' (' . $locales{$locale}->{'country'} . ')';