How to store multilingual data?

Possible duplicate:
Schema for a multilingual database

I am creating a very busy web application with multilingual data. All this data is stored in a MySQL database. What is the best way to store this data? I have a few guesses:

  • Separate columns in the table for each language (e.g. title_en, title_fr)
  • separate tables for each language (e.g. pages_en, pages_fr)
  • crosstab for translations (having an identifier in the page table and having this associated identifier in the translation table where there are several columns such as trans_en, trans_fr)
  • the presence of non-multilingual data in one table, for example, pages and translations in one table into the language (pages_en, pages_fr)
  • other?
+6
source share
1 answer

If I had to make the site multilingual, I would develop db as follows:

enter image description here

Each page of the application can have several languages. You only need to filter the language identifier to get the desired language for the page.

+1
source

Source: https://habr.com/ru/post/921333/


All Articles