andreasbakir's avatar

Laravel Localization with translated slugs

For my next project I need to build a multilanguage site (3 languages). Out of the box laravel doesn't have any good language manager. Do you guys perhaps have some experience with building a multi language site? And if so how did you succeed and what are the biggest problems you encountered?

I have searched for some packages and tutorials but everything i have found is just "meh" it is either incomplete or meant for a different purpose.

So what i am looking for is a package or a good tutorial (i couldn't find one) that allows me or teaches me how i can implement 3 languages on one laravel installation and how to manage the translations and some settings like, if translation is not available redirect to custom page or something like that.

Who can help me out :)?

0 likes
3 replies
cecosd's avatar

Easiest way is to make everything go into the current session for the current user. I am working on a code for that. Here on this link there are some ideas (for older Laravel version)

https://laracasts.com/discuss/channels/general-discussion/where-to-setlocale-in-laravel-5-on-multilingual-multidomain-app

The idea is to use a middleware for every request.

Other options are listed here, but I haven't tried them yet.

https://quickadminpanel.com/blog/10-best-laravel-packages-for-multi-language-projects/

Third option is from this link

http://www.mundointerativo.com/2017/10/12/laravel-5-5-localization-scratch/

To understand language managing. Example from the last post is:

Route::get('locale/{locale}', function ($locale) { \Session::put('locale', $locale); return redirect()->back(); });

cecosd's avatar

#Stratos You were right. This package is great!

Please or to participate in this conversation.