Hi,
I want to internationalize a cake website. My intention was to use
prefixes like
/eng/posts/index
/fra/posts/index
/deu/posts/index
to differentiate the languages for the user, search machines and the
app itself.
Whit the routing I do something like that:
Router::connect('/:language/posts/:action/*', array('controller' =>
'posts'), array('language' => '[a-z]{3}'));
This works fine. Now what I don't get to work is the url generating
with the html helper function. I tried to overwrite the url Method
with the AppHelper class, so that the current, selected language will
automtically added to the url to match the above url layout:
function url($url = null, $full = false) {
if(!is_array($url)) {
$urlString = $url;
unset($url);
$url[] = $urlString;
}
if(isset($this->params['language'])) {
$url['prefix'] = $this->params['language'];
} else {
$url['prefix'] = Configure::read('App.defaultLang');
}
$result = parent::url($url, $full);
return $result;
}
I tried some other ideas with $url['bare'] = '/fra'.$urlString; but
nothing works properly.
Do you have any ideas?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---