Hi guys,
I want to setup an i18n & i10n setup with language domains domain.tld/
language/controller/action/* parallel to a custom admin route named
backup.
Currently my routes.php looks like this:
Router::connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));
Router::connect('/pages/*', array('controller' => 'pages', 'action'
=> 'display'));
Router::connect('/backend', array('controller' => 'pages', 'action'
=> 'display', 'backend' => true, 'home'));
Router::connect('/:language/:controller/:action/*', array(), array
('language' => '[a-z]{3}');
The app_controller.php beforeFilter-function writes the language to
the Config array:
$lang = null;
if (!empty($this->params['language'])) {
$lang = $this->params['language'];
$this->Cookie->write('language', $lang, false, '+365 days');
} else {
$lang = $this->Cookie->read('language');
}
if (empty($lang)) {
$lang = Configure::read('Config.defaultLanguage');
}
Configure::write('Config.language', $lang);
The app_helper.php extends the url method:
if (!isset($url['language']) && isset($this->params['language'])) {
$url['language'] = $this->params['language'];
}
But the whole setup doesn't work. Does anybody have a complete setup
for my language approach?
Thanks in advance.
Marco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---