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


SweetPea-Application documentation  | view source Contained in the SweetPea-Application distribution.

Index


NAME

Top

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');

Top

METHODS

Top

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

Top

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


SweetPea-Application documentation  | view source Contained in the SweetPea-Application distribution.