Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2010, 07:19 PM   PM User | #1
RxDx
New Coder

 
Join Date: Jan 2010
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
RxDx is an unknown quantity at this point
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?
RxDx is offline   Reply With Quote
Old 01-09-2010, 08:49 PM   PM User | #2
PHP6
Regular Coder

 
PHP6's Avatar
 
Join Date: Aug 2008
Location: Czech Republic
Posts: 234
Thanks: 17
Thanked 34 Times in 33 Posts
PHP6 is on a distinguished road
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).
PHP6 is offline   Reply With Quote
Old 01-09-2010, 09:14 PM   PM User | #3
JAY6390
Regular Coder

 
Join Date: Dec 2009
Location: UK
Posts: 495
Thanks: 0
Thanked 58 Times in 58 Posts
JAY6390 is on a distinguished road
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 :)
JAY6390 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:20 AM.


Advertisement
Log in to turn off these ads.