Forums

ASP

This topic is locked

Creating a bilingual site

Posted 01 Jul 2003 00:56:19
1
has voted
01 Jul 2003 00:56:19 Tony Chronopoulos posted:
Hi guys! (& gals)

I'm currently building a site and I realized that since I'm located in Quebec, I should make the site in English and French! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> I don't want to split the site in 2 directories like most people do. I realized that there is probably many ways of doing this but I don't know which is the most efficient way. I was thinking of making a language.asp file and including it in all the pages. In the language.asp, I was going to make it something like this:

<pre id=code><font face=courier size=2 id=code>
&lt;%
Dim main__lang
If Request.QueryString("l" = "fr" Then
main__lang = "fr"
Else
main__lang = "en"
End If

Dim arrayLang(5)

Select Case main__language
case "en"
arrayLang(0)="Username"
arrayLang(1)="Password"
arrayLang(2)="Email"
arrayLang(3)="Sign in"
arrayLang(4)="Sign out"

case "fr"
arrayLang(0)="Nom d'utilisateur"
arrayLang(1)="Mot de passe"
arrayLang(2)="Courriel"
arrayLang(3)="Connexion"
arrayLang(4)="Déconnexion"
End Select
%&gt;
</font id=code></pre id=code>

Then in my other pages, I would simply put <pre id=code><font face=courier size=2 id=code>&lt;%=arrayLang(0)%&gt;</font id=code></pre id=code>


Would that work? or should I say, is this how it's done?

Thanks


Edited by - bloodtrain on 01 Jul 2003 01:01:11

Reply to this topic