Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a multi-language website...best way?

Status
Not open for further replies.

PaulAndrews

Technical User
Mar 22, 2002
6
GB
Hi I have been asked to do five different languages for a website!

Rather than creating five set of everything and with the hassles of modifying each set of five websites!?

What is another best way of doing this? I.e. is there something that, say when French is selected, it automatically loads in the french text, same goes for English, German etc!

Hope someone out there knows what I am on about!!

Thanks

P.
 
You could do it with asp and a session variable..Like

If Session("language") = "french"

french html

End If
If Session("language") = "german"

German html
End If The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
hmm ok - looks like the easy way - no need for additional 'french; folders and their contents etc, which I am thinking of creating now!

Alas - I am not knowledged in ASP!! Is there any example script that I can use? I am planning to put choices on homepage with choices of languages, possibly even on every page at top of the webpage (images of flags)

I know once this ASP is done, the rest should be easier! I hope!

Thanks
 
Paul,

The basic asp is as I wrote it. But you will need to assign the session variable to whatever language the user selects.

this would normally be done from a front/splash page where they get the various flags to click on.

so
======================
front.htm
======================
<html>
<body>
<a href=&quot;next.asp?language=english&quot;><img src=&quot;english.gif&quot;></a>
<a href=&quot;next.asp?language=french&quot;><img src=&quot;french.gif&quot;></a>
<a href=&quot;next.asp?language=german&quot;><img src=&quot;german.gif&quot;></a>
<a href=&quot;next.asp?language=dutch&quot;><img src=&quot;dutch.gif&quot;></a>
<a href=&quot;next.asp?language=Italian&quot;><img src=&quot;Italian.gif&quot;></a>
</body>
<html>

======================
next.asp
======================
<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
Session(&quot;language&quot;) = Request.Querystring(&quot;language&quot;)
If Session(&quot;language&quot;) = &quot;&quot; Then Session(&quot;language&quot;) = &quot;english&quot; End If
<body>
<%

If Session(&quot;language&quot;) = &quot;english&quot;
%>
english html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;french&quot;
%>
french html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;german&quot;
%>
German html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;dutch&quot;
%>
dutch html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;italian&quot;
%>
italian html
<%
End If
%>
</body>
</html>

Hopefully this will give you the basic idea, but I would recommend buying Sams Teach Youself ASP in 24 Hours The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
Sorry next.asp should be as below. also remember that the asp code is dealt with on the server so your web host will have to support asp.

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
Session(&quot;language&quot;) = Request.Querystring(&quot;language&quot;)
If Session(&quot;language&quot;) = &quot;&quot; Then Session(&quot;language&quot;) = &quot;english&quot; End If
%>
<html>
<body>
<%

If Session(&quot;language&quot;) = &quot;english&quot; Then
%>
english html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;french&quot; Then
%>
french html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;german&quot; Then
%>
German html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;dutch&quot; Then
%>
dutch html
<%
End If
%>
<%
If Session(&quot;language&quot;) = &quot;italian&quot; Then
%>
italian html
<%
End If
%>
</body>
</html> The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top