Skip to content

Instantly share code, notes, and snippets.

@bigpresh
Created February 18, 2011 22:36
Show Gist options
  • Save bigpresh/834545 to your computer and use it in GitHub Desktop.
Save bigpresh/834545 to your computer and use it in GitHub Desktop.
D::P::I18n test case
package i18ntest::I18N::en;
use base 'i18ntest::I18N';
our %Lexicon = ( hello => 'Hello' );
package i18ntest::I18N::fr;
use base 'i18ntest::I18N';
our %Lexicon = ( hello => 'Bonjour' );
package i18ntest;
use Dancer ':syntax';
use lib '/home/davidp/dev/github/dancer-plugin-i18n/lib';
use Dancer::Plugin::I18n;
use Dancer::Plugin::DebugDump;
our $VERSION = '0.1';
before_template sub {
shift->{codereftest} = sub { "Hello from coderef" };
};
get '/' => sub {
template 'index';
};
true;
Oh, <% l('hello') %>!
<br />
<% # languages('fr') %>
Or, if you're French, <% l('hello') %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment