Answer the question
In order to leave comments, you need to log in
How to make a multilingual website in laravel 5?
I want to make each language in a subdomain like on stackoverflow. How can this be done in laravel?
And how to store posts in the database? I think to make for each language the DB. How can I connect to different databases depending on the subdomain?
Am I thinking right? If not, explain how to raise a multilingual site on laravel.
Answer the question
In order to leave comments, you need to log in
How to properly implement database localization in laravel?
Here about localization of a DB.
https://laravel.ru/docs/v5/localization
Here is about the localization of the site itself (strings).
Not quite on the topic, but if you need a low-quality but fast auto-translation, then the https://github.com/stevebauman/translation
package will do
. We write in the {{_t("text for translation")}} template and when accessing example.com/en /home text will be translated into English. Translation is carried out through the Google website, but you can also configure it through the API.
Translations are stored in the database.
All lines related to the interface - in the localization files , content translation - in the database
There are special packages for content localization.
dimsav/laravel-translatable
themsaid/laravel-multilingual
Basic principle - an additional table is created to store the translation of model strings depending on the language
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question