X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FLocales.pm;h=6dd7c5a085224e39ce2763d78ab2e66b27d7bb4a;hb=c7bc6770f2f0b4413b788f8fc9abde6ad5548da3;hp=10bf72ac30222ddccee5c66c8c28477dcdbf937a;hpb=aa663c2a4134e217d3eaa0f908fe560c6bd0f4a6;p=freeside.git diff --git a/FS/FS/Locales.pm b/FS/FS/Locales.pm index 10bf72ac3..6dd7c5a08 100644 --- a/FS/FS/Locales.pm +++ b/FS/FS/Locales.pm @@ -37,6 +37,9 @@ tie our %locales, 'Tie::IxHash', 'iw_IL', { name => 'Hebrew', country => 'Israel', rtl=>1, }, ; +$_->{label} = $_->{name} . ' (' . $_->{country} . ')' + foreach values %locales; + sub locales { keys %locales; } @@ -49,7 +52,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