[Catalyst] Returning to referer - which action to take?
Ekki Plicht (DF4OR)
ep at plicht.de
Tue Sep 28 19:42:35 GMT 2010
Am Sonntag 26 September 2010, 23:05:51 schrieben Sie:
> Of course, you don't need to create a "En" or "Ro" controller for doing
> this. You can override prepare_path() or you can use the module:
>
> http://search.cpan.org/~mendel/Catalyst-Plugin-I18N-PathPrefix-0.02/lib/Cat
> alyst/Plugin/I18N/PathPrefix.pm
Unfortunately C::P::I18N::PathPrefix does not work for me, and I can't figure
out why.
in MyApp.pm I have:
use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
I18N
I18N::Request
I18N::PathPrefix
Authentication
Authorization::Roles
Session
Session::State::Cookie
Session::Store::FastMmap
Email
/;
and later in same file:
__PACKAGE__->config(
name => 'wshop',
# Disable deprecated behavior needed by old applications
disable_component_resolution_regex_fallback => 1,
# more config not shown
'Plugin::I18N::PathPrefix' => {
valid_languages => [qw/de en fr it es/],
fallback_language => 'en',
language_independent_paths => '',
debug => 1,
},
# more config not shown
);
Now when I start my app with the dev. server, it starts with the fact that
C::P::I18N::PP is not showing up in the list of loaded plugins:
[debug] Loaded plugins:
.----------------------------------------------------------------------------.
| Catalyst::Plugin::Authentication 0.10016 |
| Catalyst::Plugin::Authorization::Roles 0.08 |
| Catalyst::Plugin::ConfigLoader 0.30 |
| Catalyst::Plugin::Email 0.08 |
| Catalyst::Plugin::I18N 0.10 |
| Catalyst::Plugin::I18N::Request 0.05 |
| Catalyst::Plugin::Session 0.3 |
| Catalyst::Plugin::Session::State::Cookie 0.17 |
| Catalyst::Plugin::Session::Store::FastMmap 0.13 |
'----------------------------------------------------------------------------'
I got a controller for /test/1, works ok. But /de/test/1 gives me a 404, same
for other languages. 'fallback_languages' does work though, the output is in
whatever I set the fallback language to.
The debug output tells me:
[info] wshop powered by Catalyst 5.80027
You can connect to your server at http://armagnac:3000
[info] *** Request 1 (0.002/s) [15718] [Tue Sep 28 21:19:02 2010] ***
[debug] Plugin::I18N::PathPrefix: path 'de/test/1' is language independent
[debug] "GET" request for "de/test/1" from "127.0.0.1"
[debug] Path is "/"
[debug] Arguments are "de/test/1"
[debug] Rendering template "error404.tt"
[debug] Response Code: 404; Content-Type: text/html; charset=utf-8; Content-
Length: 5511
[info] Request took 0.159356s (6.275/s)
Any ideas?
TIA,
Ekki
More information about the Catalyst
mailing list