CakePHP support internalization, but some times I’m developing some websites that will support just one language, but usually I wrote my code in English, also the tables in the database and the text in the site, and so generate the po file for the native language of the site. But so we must write the routes too in the native language for keep the URL friendly.
You can create aliases for your routes, or you can put your router also as a translatable text, like the code above:
1
2
3
Router::connect(__('articles', true), array('controller' => 'articles'));
Router::connect(__('histories', true), array('controller' => 'histories'));
Router::connect(__('calendars', true), array('controller' => 'calendars'));
So it’s something really simple that we can use to allow the URL use the native language of the site and we also have the powerful to translate as we want in the po file in the end.
We also can combine this with the language, in the case of your site is multilanguage we can use the prefix of the language and after that we apply the translate also, so the URL will be always friendly for each language of the system.
