Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multi - language web site

Posted on 2004-09-19
9
Medium Priority
?
166 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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 750 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

688 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