S
S
Semyon Semyonov2016-02-12 14:47:17
Database design
Semyon Semyonov, 2016-02-12 14:47:17

How to store translation of object names?

There is a certain table which has a field "name". Initially, it is in Russian, for example, it can be the title of a book, the name of a company, or even the spelling of a word. The list is small, literally up to 5000 pieces.
Question: how it is possible to store the name in different languages ​​in a DB? I can make 20 columns for different languages ​​in the table (name_ru, name_en, name_jp, name_ ...), but will it be correct? I think no. Besides, what if there is another field from the table that has several languages? Then the number of columns grows insanely actively.
Thank you in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Zhainar, 2016-02-12
@zhainar

My version:
1 table - the base of all words: id, the original word - we rely on this base if there is no translation by language.
Table 2 - database of possible languages: id, language name.
Table 3 - translation base: id, word id, target language id, translation.

D
dude2012, 2016-02-12
@dude2012

How is that an option? Each language has its own table with the same name of the fields. Create a Lang variable - add it to the request in the program.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question