Data::Localize::Auto - Fallback Localizer


Data-Localize documentation Contained in the Data-Localize distribution.

Index


Code Index:

NAME

Top

Data::Localize::Auto - Fallback Localizer

SYNOPSIS

Top

    # Internal use only

METHODS

Top

register

get_lexicon

Does nothing

localize_for

Uses the string ID as the localization source

AUTHOR

Top

Daisuke Maki <daisuke@endeworks.jp>

COPYRIGHT

Top


Data-Localize documentation Contained in the Data-Localize distribution.

package Data::Localize::Auto;
use Any::Moose;

extends 'Data::Localize::Localizer';

__PACKAGE__->meta->make_immutable;

no Any::Moose;

sub localize_for {
    my ($self, %args) = @_;
    my ($id, $args) = @args{ qw(id args) };

    my $value = $id;
    if (Data::Localize::DEBUG()) {
        print STDERR "[Data::Localize::Auto]: localize_for - $id -> ",
            defined($value) ? $value : '(null)', "\n";
    }
    return $self->format_string('auto', $value, @$args) if $value;
    return ();
}

1;