Solved

Multi - language web site

Posted on 2004-09-19
9
161 Views
Last Modified: 2010-04-25
I have a site, all in English and I want to make available on the same server the same site but in a different language.

Can anyone tell me how I can detect the users browser language and automatically load the appropriate page for the user?

My site was built using Dreamweaver MX and I am hosting my site on a Windows 2000 server.  
0
Comment
Question by:ecartman
9 Comments
 
LVL 33

Expert Comment

by:humeniuk
ID: 12097098
Here are a few scripts (JavaScript) that will do what you are looking for.  They are a little different, so take a look and see which one you prefer:

http://www.javascriptkit.com/script/script2/language.shtml
http://javascript.internet.com/user-details/language.html
http://www.the-cool-place.co.uk/javascript/cutandpaste/cutandpaste4.html

Most of thse are configured to support only a few languages.  You can get a list of language codes at http://www.w3.org/WAI/ER/IG/ert/iso639.htm to use to modify the scripts to support whichever languages you wish to support.

I hope this helps.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 12099316
First of all, it's pretty much impossible to guess the user's language. And knowing the language the computer is set for doesn't mean that the user doesn't speak English. Conversely, just because the computer is set for English doesn't mean the person using it speaks English.

Second, even if you do detect the language setting, that's NOT going to translate your page. You still need multiple versions of your site.
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 12099333
All true.  So maybe the answer is, you can do it, but do you really want to, ecartman?
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:ecartman
ID: 12105831
I'm looking to see if the users browser is using Chinese, if so I want them to go to the chinese site, all other languages go to english.
0
 
LVL 33

Expert Comment

by:humeniuk
ID: 12107603
The JavaScript solutions above should work for this, but be mindful of webwoman's very valid points.  You may want to have it automatically redirect to a chines page, but consider giving you users a simple, easy to see opportunity to switch back to English.
0
 
LVL 14

Expert Comment

by:Esopo
ID: 12108313
Maybe a simple page with a 5 seconds redirect:
******************************

redirecting to chinese language, please hold.
for the english version, CLICK HERE.

******************************

Just to make sure.
0
 
LVL 9

Accepted Solution

by:
prifre earned 250 total points
ID: 12108862
Hi,

I have created a couple of multi-language sites. www.syntell.se contains swedish & english. I include a tiny JavaScript in the beginning of the page, and a couple of flags.
Also I have some simple code in the beginning (www.syntell.se/index.htm) that should help switching to swedish if the browser is set to swedish as preferred language.

I use library items in DW for the code&flags and I use naming of files:
index.html
index-s.html (for swedish), etc.

I found out that DW has problems using Templates if I use links in the template-page and if I want to have several levels. Therefore I do not have subdirectories like /swedish. A different site (classical solution) is www.intcom.se where they do use subdirectories, and kindof have a different site per language.

Depends what you want. If you want to have differnent contents for different languages, probably subdirectories are better. But if you want to have multilanguage & same contents, then probably having all language files in same place makes it easier not to forget some language stuff.

...but it's late now and therefor I am not really awake, so if the above is not really understandable, then I am really sorry, but that's all folks...

with a smile
/prifre
0
 
LVL 19

Expert Comment

by:webwoman
ID: 12112517
I really hate auto-detection of anything. If you give me an easy way to change languages, I'll change if I need to.

I like the flags, and a graphic of chinese symbols for 'site in Chinese' or something like that would also be workable for everybody, regardless of the language they used.

But I understand your point, and checking that the computer language is Chinese and switching if so is OK. Just be aware that it's far from foolproof, and give another way to switch back and forth.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to swtich to classic mode in Adobe Dreamweaver CC? 5 3,260
web development software 2 438
Getting the co-ordinates of a map 1 178
page loads much slower in IE than chrome 9 1,231
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now