diff options
author | ivan <ivan> | 2011-05-11 16:20:13 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-05-11 16:20:13 +0000 |
commit | 83053569b3d965924e2e1d4f5b199609ec7c29af (patch) | |
tree | cf7b145fe37e171045040cf9619e6aab98689cae /FS/FS/Locales.pm | |
parent | 38eb380a88ea7a130e83b77ff9c51ef6967b707b (diff) |
i18n, RT#12515
Diffstat (limited to 'FS/FS/Locales.pm')
-rw-r--r-- | FS/FS/Locales.pm | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/FS/FS/Locales.pm b/FS/FS/Locales.pm new file mode 100644 index 000000000..607f2be2d --- /dev/null +++ b/FS/FS/Locales.pm @@ -0,0 +1,61 @@ +package FS::Locales; + +use strict; +use Tie::IxHash; + +=head1 NAME + +FS::Locales - Supported locales + +=head1 SYNOPSIS + + use FS::Locales; + + my @locales = FS::Locales->locales; + +=head1 DESCRIPTION + +FS::Locales provides a list of supported locales. + +=head1 CLASS METHODS + +=over 4 + +=item locales + +Returns a list of the available locales. + +=cut + +tie our %locales, 'Tie::IxHash', + 'en_US', { name => 'English', country => 'United States', }, + 'iw_IL', { name => 'Hebrew', country => 'Israel', rtl=>1, }, +; + +sub locales { + keys %locales; +} + +=item locale_info LOCALE + +Returns a hash of information about a locale. + +=cut + +sub locale_info { + my($class, $locale) = @_; + %{ $locales{$locale} }; +} + +=back + +=head1 BUGS + +=head1 SEE ALSO + +L<FS::Msgcat> + +=cut + +1; + |