So, Is there no solution to avoid translations into routes.php ?
The best I could do (because the function 'lang' in Routes.php doesn't recognize current locale) looks like this :
PHP Code:
/*in Routes.php*/
$routes->get('fr/'.lang('App.url.art_direction_fr'), 'Pages::art_direction', ['as' => 'art_direction_fr']);
$routes->get('en/'.lang('App.url.art_direction_en'), 'Pages::art_direction', ['as' => 'art_direction_en']);
/*in view header.php*/
echo '<li><a class="menu" href="'.$base.route_to('art_direction_'.$locale).'">'.lang('App.menu.art_direction').'</a></li>';
/*in app/Language/fr/app.php ('fr' is the default language)*/
return [
'url' => [
'art_direction_fr' => 'direction_artistique',
'art_direction_en' => 'art_direction', ],
'menu' => [ 'art_direction' => 'direction artistique'; ]
];
But with that solution, it's not very clean...
Routes.php doesn't recognize current $locale, so I need two lines... And all translations of urls are in
app/Language/fr/app.php which is pretty dumb and illogical.