Data::Localize::MultiLevel - Fetch Data From Multi-Level Data Structures
use Data::Localize; my $loc = Data::Localize->new(); $loc->add_localizer( Data::Localize::MultiLevel->new( paths => [ '/path/to/lexicons/*.yml' ] ) ); $loc->localize( 'foo.key', { arg => $value, ... } ); # above is internally... $loc->localize_for( lang => 'en', id => 'foo.key', args => [ { arg => $value } ] ); # which in turn looks up... # $lexicons->{foo}->{key};
Data::Localize::MultiLevel implements a "Rails"-ish I18N facility. Namely it uses a multi-level key to lookup data from a hash, and uses the NamedArgs formatter.
To install Data::Localize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Localize
CPAN shell
perl -MCPAN -e shell install Data::Localize
For more information on module installation, please visit the detailed CPAN module installation guide.