X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FLocales.pm;h=032c3b59a9616ad3567ea6a904a285dc81b8fe3d;hb=23e8f4d6bcd1e7859600ce5791363e439739bce0;hp=351f4787549a1b479861f056ad125ed5219f7904;hpb=62b12e8b09608b7081ffd596be899fafb5c2403f;p=freeside.git diff --git a/FS/FS/Locales.pm b/FS/FS/Locales.pm index 351f47875..032c3b59a 100644 --- a/FS/FS/Locales.pm +++ b/FS/FS/Locales.pm @@ -28,13 +28,19 @@ Returns a list of the available locales. =cut tie our %locales, 'Tie::IxHash', - 'en_CA', { name => 'English', country => 'Canada', }, - 'en_US', { name => 'English', country => 'United States', }, - 'fr_CA', { name => 'French', country => 'Canada', }, - 'fr_FR', { name => 'French', country => 'France', }, - 'iw_IL', { name => 'Hebrew', country => 'Israel', rtl=>1, }, + 'en_US', { name => 'English', country => 'United States', }, + 'en_AU', { name => 'English', country => 'Australia', }, + 'en_CA', { name => 'English', country => 'Canada', }, + 'fr_CA', { name => 'French', country => 'Canada', }, + 'fr_FR', { name => 'French', country => 'France', }, + 'fr_HT', { name => 'French', country => 'Haiti', }, + 'ht_HT', { name => 'Haitian Creole', country => 'Haiti', }, + 'iw_IL', { name => 'Hebrew', country => 'Israel', rtl=>1, }, ; +$_->{label} = $_->{name} . ' (' . $_->{country} . ')' + foreach values %locales; + sub locales { keys %locales; } @@ -47,7 +53,13 @@ Returns a hash of information about a locale. sub locale_info { my($class, $locale) = @_; - %{ $locales{$locale} }; + if (!$locale) { + return (); + } elsif (exists $locales{$locale}) { + return %{ $locales{$locale} }; + } else { + die "unsupported locale '$locale'\n"; + } } =item description LOCALE