Based on this question , I am trying to translate routes in Laravel 4.2 in English and Spanish.
This is my application code /routes.php:
<?php
if (in_array(Request::segment(1), Config::get('app.web_config.alt_langs'))) {
App::setLocale(Request::segment(1));
Config::set('app.web_config.locale_prefix', Request::segment(1));
}
foreach(Lang::get('routes') as $k => $v) {
Route::pattern($k, $v);
}
Route::group(array('prefix' => Config::get('app.web_config.locale_prefix')), function()
{
Route::get('/{revelar_fotos}/',['as' => 'revelado_online', 'uses' => 'WebController@reveladoOnline'], function(){
return 'pages.revelado_online'.App::getLocale();
});
});
By clicking on the link, I get this error in the URL:
http://mywebsite.dev/%7Brevelar_fotos%7D
Instead:
http://mywebsite.dev/photograph-development
This is my en / routes.php:
<?php
return array(
'revelar_fotos' => 'photograph-development',
);
And this is my es / routes.php:
<?php
return array(
'revelar_fotos' => 'revelado-online',
);
Why did I return this error?
source
share