Solved

Multi - language web site

Posted on 2004-09-19
9
158 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
Comment Utility
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
Comment Utility
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
Comment Utility
All true.  So maybe the answer is, you can do it, but do you really want to, ecartman?
0
 

Author Comment

by:ecartman
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 33

Expert Comment

by:humeniuk
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

772 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

11 Experts available now in Live!

Get 1:1 Help Now