I would like to create a project with multi-language (country) like EN-US, EN-UK, ZH-CN. The EN-US and EN-UK site will have the same content with the different being the currency but for the ZH-CN site which is a site of China user, it would have a different content such as the footer will not have social media links (like facebook, twitter, youtube given that this service are block in china).
Each website will have the ability to which between two or three languages like the EN-US site, users will be able to switch between English and Spanish. I know how to do this switching between languages.
What i currently do not know how to do is creating the routes and how to output different content. Like do i hard code the routes, as in manually write out /en-us, /en-uk, /zh-cn into the routes.php file and each route output different content.
Hard Coding the Routes and Output the Views (Just an Example)
Route::group(['domain' => 'mysite.local'], function() {
Route::get('/en-us', function() {
return view('english.home');
});
Route::get('/zh-cn', function() {
return view('chinese.home');
});
});
Does anyone know a better way to create this type of site. Any help is appreciated.
Thanks You
0 comments:
Post a Comment