开发者

How to design a database for an Internationale website?

开发者 https://www.devze.com 2023-02-05 10:42 出处:网络
Consider an Internationale website. Let\'s say this website got some articles. Articles got some common parts between every localized website.

Consider an Internationale website. Let's say this website got some articles. Articles got some common parts between every localized website.

Like for example: ArticleID, Data, Author, CategoryID

+a field (or more) that contains the localized text for this article.

How would you design this table? 2 tables开发者_高级运维: the first containing the shared article "meta data" (look up) and the other containing a record for every localized version? Like this:

   LocalizedID     text           language    ArticleID
      1            "text in EN"    "en"          1
      2            "text in FR"    "fr"          1

or a big table containign metadata + localized text? like this:

     ArticleID - Data - Author - CategoryID - LocalizedID - TextEN - TextFR - etc

(consider the database is not huge, less than 50.000 articles)

thanks everyone


I think you should go for the first option.. if you ever want to expand (more languages or something) it is easier...

0

精彩评论

暂无评论...
验证码 换一张
取 消