Mojolicious::Plugin::I18N man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Mojolicious::Plugin::IUser3Contributed Perl DocumeMojolicious::Plugin::I18N(3)

NAME
       Mojolicious::Plugin::I18N - Internationalization Plugin

SYNOPSIS
	 # Mojolicious
	 $self->plugin('I18N');
	 % languages 'de';
	 <%=l 'hello' %>

	 # Mojolicious::Lite
	 plugin I18N => {namespace => 'MyApp::I18N'};
	 <%=l 'hello' %>

	 # Lexicon
	 package MyApp::I18N::de;
	 use Mojo::Base 'MyApp::I18N';

	 our %Lexicon = (hello => 'hallo');

	 1;

DESCRIPTION
       Mojolicious::Plugin::I18N adds Locale::Maketext support to Mojolicious.
       All you have to do besides using this plugin is to add as many lexicon
       classes as you need.  Languages can usually be detected automatically
       from the "Accept-Languages" request header.

       This plugin can save a lot of typing, since it will generate the
       following code by default.

	 # $self->plugin('I18N');
	 package MyApp::I18N;
	 use base 'Locale::Maketext';
	 package MyApp::I18N::en;
	 use base 'MyApp::I18N';
	 our %Lexicon = (_AUTO => 1);
	 1;

       Namespace and default language of generated code are affected by their
       respective options.  The default lexicon class will only be generated
       if it doesn't already exist.

OPTIONS
   "default"
	 # Mojolicious::Lite
	 plugin I18N => {default => 'en'};

       Default language, defaults to "en".

   "namespace"
	 # Mojolicious::Lite
	 plugin I18N => {namespace => 'MyApp::I18N'};

       Lexicon namespace, defaults to the application class followed by
       "::I18N".

HELPERS
   "l"
	 <%=l 'hello' %>
	 $self->l('hello');

       Translate sentence.

   "languages"
	 <% languages 'de'; %>
	 $self->languages('de');

       Change languages.

METHODS
       Mojolicious::Plugin::I18N inherits all methods from Mojolicious::Plugin
       and implements the following new ones.

   "register"
	 $plugin->register;

       Register plugin hooks and helpers in Mojolicious application.

SEE ALSO
       Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.

perl v5.14.1			  2011-09-01	  Mojolicious::Plugin::I18N(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net