X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FLocales.pm;h=23a95caeabfd08a4f16fd4be8d1e7db141815325;hp=351f4787549a1b479861f056ad125ed5219f7904;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hpb=62b12e8b09608b7081ffd596be899fafb5c2403f diff --git a/FS/FS/Locales.pm b/FS/FS/Locales.pm index 351f47875..23a95caea 100644 --- a/FS/FS/Locales.pm +++ b/FS/FS/Locales.pm @@ -28,13 +28,24 @@ 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', }, + 'es_ES', { name => 'Spanish', country => 'Spain', }, + 'es_CU', { name => 'Spanish', country => 'Cuba', }, + 'es_MX', { name => 'Spanish', country => 'Mexico', }, + 'es_PA', { name => 'Spanish', country => 'Panama', }, + 'es_US', { name => 'Spanish', country => 'United States', }, + '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 +58,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