Welcome Guest, Not a member yet? Register   Sign In
Localization in Routes
#2

Why u wan't push locale into url's?
Better solution is store locale in session/cookie and allow user change-language select.

In own project I make routes based on locale but like this:

PHP Code:
$routes->add(lang('Url.user_login'), 'Home::index'); 

Then in my Languages/pl/Url.php (polish) have:

PHP Code:
return [
'user_login' => '/logowanie'
]; 


or other example Languages/en/Url.php (english) have:


PHP Code:
return [
'user_login' => '/some-login-extra-link'
]; 
And this work's fine for SEO and I have "localized" links.
Reply


Messages In This Thread
Localization in Routes - by Dmonkeyjazz - 10-24-2018, 05:24 AM
RE: Localization in Routes - by Przem4S - 11-06-2018, 02:01 AM
RE: Localization in Routes - by Pertti - 11-06-2018, 02:35 AM
RE: Localization in Routes - by Dmonkeyjazz - 11-09-2018, 04:50 AM
RE: Localization in Routes - by puschie - 11-09-2018, 07:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB