How to design a database schema for storing text in multiple languages?

前端 未结 2 1290
清歌不尽
清歌不尽 2021-01-13 07:20

We have a PostgreSQL database. And we have several tables which need to keep certain data in several languages (the list of possible languages is thankfully system-wide defi

相关标签:
2条回答
  • 2021-01-13 07:44

    Here's a great article the Mozilla developers put together on making their database multilingual. It's specific to CakePHP, but the info can easily be applied to other systems. Also, note that it makes SQL queries significantly more complex, which is a drawback. That will generally be true regardless of your i18n implementation, though.

    1. Part 1
    2. Part 2
    3. Part 3
    0 讨论(0)
  • 2021-01-13 07:56

    I think it is best if you create two tables. One for languages, one for ids and so on. first_table( id ) second_table( s_id, id_first_table, language_id, language_text)

    0 讨论(0)
提交回复
热议问题