Irish SEO,  Marketing & Webmaster Discussion
 
Affiliates get Paid On Results, Click Here!
 

Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help


Notices

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-04-2008, 12:53 AM
ziycon's Avatar
Wannabe Geek
Recent Blog: Life with Playstation
 
Join Date: Jan 2007
Location: Dublin
Posts: 363
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default Multi-Language Site

I'm about to start work on a new project of mine and i want to build in the future functionality of multiple languages.

The way i have it in my head is that i would have a select field on every page with the different menu options and using AJAX, when a user changes the language on any page the new language will follow the user throughout the site until changed again.

Example:
The index.php page has a default of English so it loads with the en.php file which holds all site variables in English. Once the language has been changed the the session variable that was set to en.php by default will change to the new language French by putting the fr.php into the language session variable.

The problem is how do i refresh the page without reloading it completely. The reason being i cant see a way that the AJAX can reload all the page variables or am i wrong.
If i enclosed the whole site in a span would it refresh upon a new language being selected?

Any help appreciated as always.
Reply With Quote
  #2 (permalink)  
Old 11-04-2008, 07:30 AM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 1,770
Nominated 2 Times in 1 Post
TOTW/F/M Award(s): 0
Forbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond repute
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

really I'd forget about using ajax to do this .... whats the advantage over just reloading the complete page ? Yes it sounds cool .... I've got the languages tied into an ajax refresh mechanism ...

You're going to have to give all of your strings id's and update them all .. which means loading the new language file completely and doing lots of parsing ... personally I think its better to do it server side.
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - South Africa Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Reply With Quote
  #3 (permalink)  
Old 11-04-2008, 09:35 AM
Cormac's Avatar
Cormac Moylan
 
Join Date: Jan 2006
Location: Baile Ath Cliath / Corcaigh
Posts: 1,191
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Cormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to behold
Send a message via AIM to Cormac Send a message via MSN to Cormac Send a message via Yahoo to Cormac Send a message via Skype™ to Cormac
Default

It's best to use a directory structure too rather than passing variables on an index.php file or similar.

A directory is more semantically structured and can you can geo-target a directory a lot easier than something like index.php?lang=en.

en.site.com / fr.site.com
or
site.com/en/ site.com/fr

is the way to go. Be sure to the ISO Country identifiers (fr/de/en/es/it/jp).

I setup something similar a few weeks ago with Wordpress MU. I have an English and Polish blog running off the same system.
ammado blog + Polski blog ammado
__________________
my blog | Apple Mac Blog | Indie Music Blog | *
Reply With Quote
  #4 (permalink)  
Old 11-04-2008, 10:58 AM
ziycon's Avatar
Wannabe Geek
Recent Blog: Life with Playstation
 
Join Date: Jan 2007
Location: Dublin
Posts: 363
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default

Quote:
Originally Posted by Forbairt View Post
really I'd forget about using ajax to do this .... whats the advantage over just reloading the complete page ? Yes it sounds cool .... I've got the languages tied into an ajax refresh mechanism ...

You're going to have to give all of your strings id's and update them all .. which means loading the new language file completely and doing lots of parsing ... personally I think its better to do it server side.
So maybe just have a JS onchange function for the select box and once that function runs just have a reload page statement and change the session variable for the language!?

Quote:
Originally Posted by Cormac View Post
It's best to use a directory structure too rather than passing variables on an index.php file or similar.

A directory is more semantically structured and can you can geo-target a directory a lot easier than something like index.php?lang=en.

en.site.com / fr.site.com
or
site.com/en/ site.com/fr

is the way to go. Be sure to the ISO Country identifiers (fr/de/en/es/it/jp).

I setup something similar a few weeks ago with Wordpress MU. I have an English and Polish blog running off the same system.
ammado blog + Polski blog ammado
Was planing on something along the line of site.com/en/, is there much difference or is it better to use a subdomain like en.site.com over site.com/en/?
Reply With Quote
  #5 (permalink)  
Old 11-04-2008, 11:10 AM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 1,770
Nominated 2 Times in 1 Post
TOTW/F/M Award(s): 0
Forbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond repute
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

Quote:
Originally Posted by ziycon View Post
Was planing on something along the line of site.com/en/, is there much difference or is it better to use a subdomain like en.site.com over site.com/en/?
You're kinda contradicting yourself here ...

If you're planning on having en.site.com or site.com/en ... then having the page stay the same but changing language is a bit crazy no ?

For indexing purposes as well ... having Javascript links to the other languages isn't really ideal.
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - South Africa Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Reply With Quote
  #6 (permalink)  
Old 11-04-2008, 11:22 AM
RedCardinal's Avatar
Richard Hearne
 
Join Date: Feb 2006
Posts: 937
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
RedCardinal is a splendid one to beholdRedCardinal is a splendid one to beholdRedCardinal is a splendid one to beholdRedCardinal is a splendid one to beholdRedCardinal is a splendid one to beholdRedCardinal is a splendid one to beholdRedCardinal is a splendid one to behold
Default

Quote:
Originally Posted by ziycon View Post
is there much difference or is it better to use a subdomain like en.site.com over site.com/en/?
Small difference alright. You actually have to dig into the balckhat world to find out what though...

Personally I prefer subdirs, but little or no difference for most sites.
__________________
Search Engine Optimisation - Red Cardinal Internet Marketing
Internet Consultant Ireland | Search Engine Optimisation Services
Catering Company Dublin - My sister's handmade canape company!
Reply With Quote
  #7 (permalink)  
Old 11-04-2008, 11:43 AM
ziycon's Avatar
Wannabe Geek
Recent Blog: Life with Playstation
 
Join Date: Jan 2007
Location: Dublin
Posts: 363
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default

Quote:
Originally Posted by Forbairt View Post
You're kinda contradicting yourself here ...

If you're planning on having en.site.com or site.com/en ... then having the page stay the same but changing language is a bit crazy no ?

For indexing purposes as well ... having Javascript links to the other languages isn't really ideal.
Well originally i was planning on just having a session variable that would have 'en' or 'fr' and based on that then an include('lang/'.$_SESSION['lang'].'.php'); on each page and if the lang session variable isn't set then default it to 'en', the problem is just not sure how to change the language, like said before AJAX wouldn't be recommend, so not sure where to go from that!?
Reply With Quote
  #8 (permalink)  
Old 11-04-2008, 01:36 PM
Coder
 
Join Date: Mar 2008
Posts: 73
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
byronyasgur will become famous soon enough
Default

dont know if it interests you (and there are other versions of this type of thing) but i was researching the building of a site (2 languages) in the joomla CMS ...... and i came accross an interesting plugin called joomfish - it doesnt do translations but acts as a sort of translation management system --- seemed to be pretty good and i'd say it would be what i would use if i was doing a multilinugal site
__________________
RainRain Web Design - OneWeekofDays
Reply With Quote
  #9 (permalink)  
Old 11-04-2008, 01:44 PM
Cormac's Avatar
Cormac Moylan
 
Join Date: Jan 2006
Location: Baile Ath Cliath / Corcaigh
Posts: 1,191
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Cormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to beholdCormac is a splendid one to behold
Send a message via AIM to Cormac Send a message via MSN to Cormac Send a message via Yahoo to Cormac Send a message via Skype™ to Cormac
Default

Quote:
Originally Posted by ziycon View Post
Was planing on something along the line of site.com/en/, is there much difference or is it better to use a subdomain like en.site.com over site.com/en/?
I much prefer subdomains as they look cleaner and are more visible than subdirectories . It's a tad bit easier for a French user to bring up fr.site.com rather than site.com/fr because the browser history drop down will be populated with more relevant results (as in they start typing fr into their browser, it brings up fr.site.com/etc... straight away which is probably what they want rather than site.com/fr/whatever.. which brings up all the site.com pages before they enter fr). Do you get that?
__________________
my blog | Apple Mac Blog | Indie Music Blog | *
Reply With Quote
  #10 (permalink)  
Old 11-04-2008, 02:15 PM
ziycon's Avatar
Wannabe Geek
Recent Blog: Life with Playstation
 
Join Date: Jan 2007
Location: Dublin
Posts: 363
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default

Quote:
Originally Posted by Cormac View Post
I much prefer subdomains as they look cleaner and are more visible than subdirectories . It's a tad bit easier for a French user to bring up fr.site.com rather than site.com/fr because the browser history drop down will be populated with more relevant results (as in they start typing fr into their browser, it brings up fr.site.com/etc... straight away which is probably what they want rather than site.com/fr/whatever.. which brings up all the site.com pages before they enter fr). Do you get that?
I get what your saying and i can see where your coming from, nothing more annoying then hundreds of link options popping up from your history when typing in a URL!
Reply With Quote
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Language Sites SineadOD Search Engine Optimisation 8 26-04-2008 08:22 AM
Ok So I Went Crazy - Review My Design Site Baz Site Reviews / Announcements 26 27-03-2008 05:40 PM
Successful Site in 12 Months with Google Alone montyauto Webmaster Articles 11 18-02-2008 12:28 PM
Multi Language Sites & SEO searchcreations Search Engine Optimisation 12 07-01-2008 09:34 PM
multi language site matrixroyal CMS and Content Management 2 27-03-2007 05:00 PM


All times are GMT +1. The time now is 08:21 AM.


Powered by: vBulletin Version 3.7.2, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.

Search Engine Friendly URLs by vBSEO 3.2.0