X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FLocales.pm;h=032c3b59a9616ad3567ea6a904a285dc81b8fe3d;hb=23e8f4d6bcd1e7859600ce5791363e439739bce0;hp=10bf72ac30222ddccee5c66c8c28477dcdbf937a;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/FS/FS/Locales.pm b/FS/FS/Locales.pm index 10bf72ac3..032c3b59a 100644 --- a/FS/FS/Locales.pm +++ b/FS/FS/Locales.pm @@ -29,6 +29,7 @@ Returns a list of the available locales. tie our %locales, 'Tie::IxHash', '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', }, @@ -37,6 +38,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 +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