Good day to all. Please tell me faced with such a task. There is an online store written in Laravel 5.4 Online store in Russian, the task is to add English.
As I see the solution to this problem:
Add a table with localization to the database. (En, ru)
In all existing tables add external id to ru
Create tables and fill them with English content and hang on them external id on en
Check depending on what prefix came and pull information from the right tables.
This is a very time-consuming solution that requires changing the database structure. Also in the admin add fields under the English content. And if, for example, tomorrow they also say that German will be added, then all this will need to be repeated again, and so on.
Perhaps there is some simpler way of this implementation on Laravel 5.4?
Pagestable that hasTitle,Descriptionfields, makeTitle_ru,Title_en, etc. of them. Then, when you determine the current language, make queries of the formSELECT Title_{$currentLang} AS Title- DaemonHK