Solved

Multi - language web site

Posted on 2004-09-19
9
162 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ColdFusion dropdown multiple select question 3 667
xml to xml using xslt and php 4 558
Editing PHP within Adobe DreamWeaver 11 188
.dwt files not viewable in browser - why? 2 117
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

713 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