Solved

Multi - language web site

Posted on 2004-09-19
9
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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 …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

617 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