language support without altering database structure

I have a question regarding support for languages on a website.

What is the best way to structure a database, while using multiple languages? For example, while creating a database schema that has an agenda table, a news table and a products table. All of these components have a description and a title.

The structure then would be:

  • Agenda (id, title, description)
  • News (id, title, description)
  • Products (id, title, description)
  • Normally, I create a languages table. Every aforementioned table would get an extra column; language_id.

    That means every translation of a record gets inserted again, using a different ID. The advantage of this method is that you can add multiple languages , without altering the database (you can just add a new row in the newly created language table, and insert a corresponding language_id in the news/agenda/products table).

    Know I am aware of the fact that this is very cumbersome. The rows that basically have the same content - only in a different translation - have no way of knowing they are the same.

    I have seen many approaches, like using a 'translation' table. So you'd get an extra news_translation, products_translation and a agenda_translation.

    Is there another solution for this, without the need of adding a translation table for every component?

    Thanks in advance.

    链接地址: http://www.djcxy.com/p/6396.html

    上一篇: 颠覆外部是反模式吗?

    下一篇: 语言支持而不改变数据库结构