Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Posts
    1

    Unanswered: Multi-language database design question

    Hello,
    I have found some other threads on this topic, however i have not found the answer I'm looking for.

    There's the scenario:
    I am using a MySql database for a multi-language website, mainly with blogs and comments. For each blog, there will be translations in 3 other languages. However, there will be cases where one or more of the translations will NOT exist. Also, the original thread can be in any one of these 4 languages.

    Here is what i came up with so far:
    One DB and one table called "blogs", and a different field for each language:
    blog_en_EN, blog_es_ES, etc. and a different field is selected depending on the language. This way, only one primary key is enough to identify all languages of the blog.

    However, I just don't like this. It seems like it would work fine, but it's redundant.

    The ideal case would be having different tables for each language which share a primary key, however I don't know if this is even possible.
    If sharing a key is not possible, i think linking the languages together with another field would make it more error prone.

    I would appreciate any ideas or comments,
    Thanks.
    - Murat

  2. #2
    Join Date
    Jul 2007
    Posts
    96
    Quote Originally Posted by mayfer
    Here is what i came up with so far:
    One DB and one table called "blogs", and a different field for each language:
    blog_en_EN, blog_es_ES, etc. and a different field is selected depending on the language. This way, only one primary key is enough to identify all languages of the blog.
    So, if tomorrow you support every single language in the world you end up with a table with a column for every single one of them, plus the rest of the fields needed for the blog. I would have to agree, that doesn't seem like the ideal solution at all

    Quote Originally Posted by mayfer
    The ideal case would be having different tables for each language which share a primary key, however I don't know if this is even possible.
    If sharing a key is not possible, i think linking the languages together with another field would make it more error prone.
    Again, your idea is to add an object (table in this case) for every possible variant of the language. Not that optimal either.

    Maybe you should consider having a table that holds the blog meta data and another table that holds the actual text values, this along with a mechanism to identify and switch between the languages in which the blog is available, be it the default language for that particular post or not

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Just a quick suggestion

    PostContent(postID, languageID, content)
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •