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 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Best way for bilingual site

    Hello,

    I need to launch bilingual site. What is the best and more efficient way to organize database, files and scripts that change language for both admin area and client area?

  • #2
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    237
    Thanks
    18
    Thanked 34 Times in 33 Posts
    First of all you will need to use Unicode for your tables. Second you will need to create different HTML pages for different languets and finally you will need to have some kind of message dictionary which will be used in the PHP script (all texts should be encoded with the same encoding).

    As for the part how you will implement everything, it is really hard to say, there is not unique or the best way) I never used database for that, I prefer different folders with all data inside (HTML + one dictionary file). So later to change the language I just need to change one variable (the source).

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    It all depends on how diverse your content is and how you want to load the content. Personally I'd use subdomains for each language, like en.yoursite.com, de.yoursite.com, fr.yoursite.com for English, German and French languages respectively. Then just call up your bootstrap for the site, figure out the language from the domain and load your data for that language from a template file of predefined strings for that language
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)


  •  

    Posting Permissions

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