C
C
Cyril2017-12-05 07:36:13
MySQL
Cyril, 2017-12-05 07:36:13

Is it correct to store articles in the localization table like this?

There is some table article_tbl , which stores articles, say, about cooking. All articles are initially added in Russian, because. All authors are Russian.
But there may be cases when an article is translated by the author into another language (English, German, etc.).
Can you please tell me if the structure of the article_tbl table is correct for storing such articles? Here is its view:
5a26207a9d484525186571.png
As you can see, when a translation of an article is added to the table, the localization (language) field and the parent_id field are indicated, pointing to the original (not translated) article. This is done so that the web application can conveniently receive an article in the desired language, depending on the country in which the web site is viewed. That is, in Germany they will see all the articles that are in German, but they will be able to see them in Russian if they wish.
The table filled with data looks something like this:
5a2621f546394533761172.png
Is it correct to store article localizations in this form? Or it is better to get the intermediate table? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kalibrov, 2017-12-05
@rework

In theory, articles in any language should be equivalent, that is, there should not be a parent_id.
I would start tables:
Then you will be able to write in article_tbl the general data for any localization on the article. But your approach also has the right to life.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question