X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FLocales.pm;h=d1f3eed229da5b580db4109e36e5b92614818a2a;hb=a354fed1dedc65cf62e63d940e1cfb9c4364e6d3;hp=351f4787549a1b479861f056ad125ed5219f7904;hpb=62b12e8b09608b7081ffd596be899fafb5c2403f;p=freeside.git diff --git a/FS/FS/Locales.pm b/FS/FS/Locales.pm index 351f47875..d1f3eed22 100644 --- a/FS/FS/Locales.pm +++ b/FS/FS/Locales.pm @@ -28,13 +28,25 @@ 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_AR', { name => 'Spanish', country => 'Argentina', }, + '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 +59,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