The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SweetPea::Application::Locale - Localization handling for SweetPea-Application.

SYNOPSIS ... from inside SweetPea::Application or a Controller; $s->locale->language('en'); my $text = $s->locale->text('hello_message');

METHODS

new

    The new method instantiates a new SweetPea::Application::Locale object
    which use Config::Any w/ YAML::Syck as a base class to provide access
    to the yml locales.
    
    $s->plug( 'config', sub { return SweetPea::Application::Locale->new($s); });

language

    The language method selects the specific localization data(yml) file to be
    used to provide translations to the application.
    
    $s->locale->language('/en');

text

    The text method retrieves the translation text from the locale file selected
    with the "language" method. Defaults to "en" (english) translation.

AUTHOR

Al Newkirk, <al.newkirk at awnstudio.com>