Skip to content

Commit

Permalink
removed Mojolicious::Plugin::I18N so it can be maintained as a separa…
Browse files Browse the repository at this point in the history
…te distribution (closes #338)
  • Loading branch information
kraih committed Jun 15, 2012
1 parent 777b9e1 commit b95f445
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 428 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,6 +1,8 @@

3.0 2012-06-15
- Code name "Rainbow", this is a major release.
- Removed Mojolicious::Plugin::I18N so it can be maintained as a separate
distribution.
- Switched from HMAC-MD5 to HMAC-SHA1 for signed cookies.
- Added support for new HTTP status code.
- Renamed Mojo::CookieJar to Mojo::UserAgent::CookieJar.
Expand Down
2 changes: 1 addition & 1 deletion README.pod
Expand Up @@ -21,7 +21,7 @@ through L<Mojolicious::Lite>.

Powerful out of the box with RESTful routes, plugins, Perl-ish templates,
session management, signed cookies, testing framework, static file server,
I18N, first class Unicode support and much more for you to discover.
first class Unicode support and much more for you to discover.

=back

Expand Down
4 changes: 0 additions & 4 deletions lib/Mojolicious.pm
Expand Up @@ -570,10 +570,6 @@ automatically.
Route condition for all kinds of headers, loaded automatically.
=item L<Mojolicious::Plugin::I18N>
Internationalization helpers.
=item L<Mojolicious::Plugin::JSONConfig>
JSON configuration files.
Expand Down
31 changes: 0 additions & 31 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -744,37 +744,6 @@ templates.

Less commonly used and more powerful features.

=head2 Internationalization

Thanks to L<Locale::Maketext> all you need for basic internationalization
support in your application is the plugin L<Mojolicious::Plugin::I18N> and a
few lexicon classes.

package MyApp::I18N::de;
use Mojo::Base -strict;
use base 'MyApp::I18N';

our %Lexicon = ('Hello World' => 'Hallo Welt');

package main;
use Mojolicious::Lite;

plugin I18N => {namespace => 'MyApp::I18N'};

get '/' => 'hello';

app->start;
__DATA__

@@ hello.html.ep
<%=l 'Hello World' %>!

Preferred languages will be automatically detected from the C<Accept-Language>
header or can be manually changed with the helper
L<Mojolicious::Plugin::I18N/"languages">.

$ ./myapp.pl get -H 'Accept-Language: de' /

=head2 Chunked transfer encoding

For very dynamic content you might not know the response C<Content-Length> in
Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -32,6 +32,7 @@ sub parse {
return $config;
}

# "Planet Express - Our crew is replaceable, your package isn't."
sub register {
my ($self, $app, $conf) = @_;

Expand Down
180 changes: 0 additions & 180 deletions lib/Mojolicious/Plugin/I18N.pm

This file was deleted.

2 changes: 2 additions & 0 deletions lib/Mojolicious/Plugin/Mount.pm
Expand Up @@ -3,6 +3,8 @@ use Mojo::Base 'Mojolicious::Plugin';

use Mojo::Server;

# "Can we have Bender burgers again?
# No, the cat shelter's onto me."
sub register {
my ($self, $app, $conf) = @_;

Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Plugin/PODRenderer.pm
Expand Up @@ -111,6 +111,7 @@ sub register {
) unless $conf->{no_perldoc};
}

# "Aw, he looks like a little insane drunken angel."
sub _pod_to_html {
return unless defined(my $pod = shift);

Expand Down
6 changes: 4 additions & 2 deletions lib/Mojolicious/Plugins.pm
Expand Up @@ -5,6 +5,8 @@ use Mojo::Util 'camelize';

has namespaces => sub { ['Mojolicious::Plugin'] };

# "Also you have a rectangular object in your colon.
# That's a calculator. I ate it to gain its power."
sub emit_hook {
my $self = shift;
$_->(@_) for @{$self->subscribers(shift)};
Expand All @@ -31,8 +33,6 @@ sub emit_hook_reverse {
return $self;
}

# "Also you have a rectangular object in your colon.
# That's a calculator. I ate it to gain its power."
sub load_plugin {
my ($self, $name) = @_;

Expand All @@ -54,6 +54,8 @@ sub register_plugin {
shift->load_plugin(shift)->register(shift, ref $_[0] ? $_[0] : {@_});
}

# "Hey, I don't see you planning for your old age.
# I got plans. I'm gonna turn my on/off switch to off."
sub _load {
my ($self, $module) = @_;

Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -199,6 +199,7 @@ sub _detect_handler {
return;
}

# "Robot 1-X, save my friends! And Zoidberg!"
sub _extends {
my ($self, $c) = @_;
my $stash = $c->stash;
Expand Down

0 comments on commit b95f445

Please sign in to comment.