That's what I googled. Saw such options is site.com/en or site.com/ru ie I chose a language, for example Russian, and if I go to the page about us, it will be something like that site.com/ru/o_nas, if in English then site.com/en/o_nas There is a page en and ru and through them it works. I also saw such index.php? Lang-en or index.php? Lang-ru, these get parameters are appended when I click on the language selection and let's say the main one has been translated, although I haven’t succeeded yet. but if you go to site.com/o_nas then these get parameters disappear. I need that when I clicked on en | ru, respectively, the site was completely transferred and which page I wouldn’t go to in the selected language. At the expense of cookies and sessions, they are not important now, the main thing is that until the browser is closed the language remains selected until the user switches to another.
OOP and the like is not necessary, the simplest on procedural.
I have everything taken from the database as I understand it. If you need 2 languages, then you need to create 2 o_nas_ru and o_nas_en tables each and then write to the right one. But in practice it does not work.
block to switch the language.
<div class="tag">Language:<a href="index.php?lang-en">English</a>|<a href="index.php?lang=ru">Русский</div> How to do what I described above, and that the necessary text from the admin panel was written to the desired table (there will be two fields in the admin panel at once, for example, for Russian and English. Text and in the database are different tables) and displayed depending on what is selected on the site ru or en? Can a small example to understand the essence.
And how to make a Russian standard, i.e. what would not just be index.php loaded into index.php.ru or index.php? lang.ru as correct?