Daisuke Maki > Data-Localize-0.00023 > Data::Localize::MultiLevel

Download:
Data-Localize-0.00023.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source   Latest Release: Data-Localize-0.00026

NAME ^

Data::Localize::MultiLevel - Fetch Data From Multi-Level Data Structures

SYNOPSIS ^

    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};

DESCRIPTION ^

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.

METHODS ^

get_lexicon

set_lexicon

load_from_path

syntax highlighting: