Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    217
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to develop multilingual website?

    Hello forums!!

    I would like to have the experts to share about developing multilingual websites.

    AFAIK, Multilingual Websites generally consists of two parts:
    1> Static (Form labels, Header titles, Messages etc., Generally file based)
    2> Dynamic (Db Contents like Categories, news posts etc, Obviously db based)

    Managing Static contents is easy which can be easily done as:
    Code:
    en
    - form_label.php
    - messages.php
    :
    etc
    nl
    - form_lable.php
    - messages.php
    :
    :
    language files generally consists of associative arrays or defined as constants for the static content translation.

    But the complexity part comes with the Dynamic contents translation.
    I would like to know how you develop the multilingual website (esp for dynamic contents).

    Thanks for the ideas/suggestions in advance.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,519
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    I've looked into this before.
    I saved a few bookmarks ...

    This one using Smarty, a method of XML files - maybe some good ideas here:
    http://www.phpinsider.com/smarty-for...topic.php?t=84

    Then, I realized there are a variety of methods, but I like XML files myself.
    I never did the scripting for it though. Here's a lot more information, but I
    assume you've already looked here?
    http://www.google.com/search?hl=en&q...&aq=f&oq=&aqi=

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Posts
    217
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thats only for static content translation. I want some suggestion for dynmic contents ie db based contents.
    Thanks

  • #4
    Regular Coder
    Join Date
    Dec 2005
    Posts
    217
    Thanks
    1
    Thanked 0 Times in 0 Posts
    For db design for multilingual website, i have come up with following solutions
    and don't know which one is perfect also want to know if there is any other good options

    Obviously firstly we need language table as:
    ----------------
    |languages
    ----------------
    |id
    |code
    |flag
    |is_active
    ----------------
    Possible solutions
    1> using one table(suppose we have 'news' table for example)
    ------------
    |news
    -------------
    |id
    |language_id
    |title
    |body
    |created_by
    |created_date
    |is_active
    :
    :
    2> Using two tables
    ------------
    |news
    -------------
    |id
    |created_by
    |created_date
    |is_active
    :
    :
    ---------------
    |news_contents
    ---------------
    |id
    |news_id
    |language_id
    |title
    |body
    ----------------
    3> Using one master table for all tables which needs translation
    --------------
    |news
    --------------
    |id
    |title
    |body
    |created_by
    |created_date
    |is_active
    ---------------
    ------------
    |categories
    -------------
    |id
    |title
    |description
    |is_active
    --------------
    master table:
    ---------------
    |translation
    ---------------
    |id
    |language_id
    |table_name
    |table_field
    |translated_value
    ----------------
    I have found all these structure so far, dont know which one is better as i havent used such in my multilingual website.
    I would like to know the pros n cons for these structures, best db structure.

    Note: Any no of languages can be added ranging from 1 -> N

    Thanks for the help again in advance.

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Code:
    -------------
    create table languages
    ( language varchar(99) not null primary key
    , code char(3) not null
    , flag_image varchar(64) not null
    ) engine......
    
    English
    French
    German
    Spanish
    Italian
    etc
    -------------
    
    
    
    ------------
    |news
    -------------
    |id
    |language (optional fk to language table)
    |title
    |body
    |created_by
    |created_date
    |is_active
    :
    :
    then your query works just like when you only provide content in one language but that you conditionalise it with ~ where langauge = 'french'

    If there is no content to match the query it will not return a result so I am not sure about the need for an 'is active' column.

    I think the biggest issue is, who's going to privide all the translation if you have a lot of content pages in your first language, that might lead to an awful lot of translation costs.

    On the other hand, if you want only to provide headings in the other langauges (I do dislike the term, foreign), that is likely to be a one to many relationship and 3nf normalisation would resolve that in terms of db structure.

    hth

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Posting Permissions

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