Messing with common i18n modules.
[blog.pm.git] / lib / Blog / Plugin / I18N / URI.pm
blob94349a046df018e27aeea442b6aacd786393d046
1 package Blog::Plugin::I18N::URI;
3 use strict;
5 sub uri_for {
6 my ( $c, @subpath ) = @_;
8 if ( @subpath && $subpath[0] ne '/' ) {
9 @subpath = grep { defined $_ && $_ ne '' } @subpath;
11 unless ( $subpath[ 0 ] && $subpath[ 0 ] =~ s/^\/+//xo ) {
12 my $action = $c->req->action;
13 $action =~ s/^\/+//xo;
14 unshift @subpath, $action;
17 unshift @subpath, ( '/' . $c->language );
20 return $c->NEXT::uri_for( @subpath );