This question has already been answered:

I want to create a 4-language website, but I don’t know how to get started. Please tell me.

Reported as a duplicate by participants PashaPash , torokhkun , ermak0ff , xaja , Yuri Glushenkov Nov 15 Nov '15 at 10:35 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • content => yaz1. yaz2. yaz3 yaz4. - Bastiane

2 answers 2

Is the site static? Who is doing the filling and how often? What exactly needs to be translated? Do I need to translate text on images? Will additional languages ​​be added during use? A bunch of questions. Sometimes it is more convenient to create a complete copy of the site and make an adaptation for another language. Tell us more about the problem.

  • No, there will be no transfer. I just want to create fields for a 4-language site in the database, but I don’t know where to start. - user22977
  • Create a table with languages ​​Lang (id, name) Create a table with texts Texts (id, text, lang_id) Then you define the language that the user needs, and take the corresponding texts from the database. - Get

Well, how.
Create 3 files of dictionaries (or in the database, which in some cases is even better).

Type, for example:

{ 'hello':'здравствуй', 'world':'мир' } 

For all other languages ​​except the main one (English is better as it).

Output all phrases, inscriptions and texts through the translation function, which takes the current language from the system settings and translates the phrase.

  • > Output all phrases, inscriptions and texts through the translation function, which takes the current language from the system settings and translates the phrase. Horrible way, too much. - Bastiane
  • It is quite common. The main thing, if you write the function correctly, there will be no brakes. Let's say I like this method a lot more than to produce patterns. - knes