I have such a link:
<?=$this->Html->link(__('Kontakt'), array('controller' => 'contacts', 'action' => 'show', 'language' => $this->Session->read('Config.language')));?>
My route looks like this:
Router::connect('/kontakt', array('controller' => 'contacts', 'action' => 'show', 'language' => 'deu'));
This way I get such a link in browser:
domain.com/kontakt (german is my base language)
Now I want the other languages as well, therefore I transport the language flag with the url in order to get this:
domain.com/eng/contact (all languages except german need this language shortcut)
I have this route
Router::connect('/:language/kontakt', array('controller' => 'contacts', 'action' => 'show'),
array( 'language' => 'eng|spa|fre|rus' ));
This creates my nicely urls like:
/spa/kontakt or /eng/kontakt or /fre/kontakt
I wonder now, how I can set the the translated words into the routes, without having a single line for each translation? Is there a way to make it somehow dynamic?
Thanks!