N
N
No Name2015-11-01 20:32:57
Database design
No Name, 2015-11-01 20:32:57

How to design a database for a multilingual site?

I am writing a website. It will have a news feed and the possibility of registration . + Need support for 2 languages ​​- [rus] + [en].
There is an option to design a database, and then make duplicate fields with the EN_ prefix , but I think this is a bad idea. How to solve this problem?
Entities at the initial stage:

  • news - news
  • events — events
  • users - users
  • admins - admins
Events are a subset of news , i.e. each event is included in a set of news . There is uncertainty
about admins : will they be a subset of users or an independent entity?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2015-11-01
@Rsa97

If the news is always filled in both languages ​​and the number of languages ​​will not grow, then just two fields _en and _ru.
Otherwise, you need to make a separate table of headers, text, etc. in the form (id_news, id_language, text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question