INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

ASP 102

Multi-Language Web Site by Bullschmidt
Posted: 22 May 03 (Edited 28 May 03)

If you are considering developing a multi-language Web site, perhaps have a file called something like translate.asp (which contains a function call TranslateIt()) included in each page.  Thus toward the top of a regular Web page you might have the following:
<!--#include file="translate.asp"-->

And on Web pages wherever regular text is used, use the function from translate.asp instead.

So for a button that says "Close" in English and something with the same meaning in other languages the button might look like this:
<input type="submit" name="btnClose" value="<%= TranslateIt("Close") %>">

And there could be a session variable called Language that is set somewhere:
Session("Language") = "German"

And here is the TranslateIt() function in the translate.asp include file:

Function TranslateIt(pstrStatement)
 Select Case Session("Language")
  Case "English"
   Select Case pstrStatement
    Case "Close"
     TranslateIt = "Close"
    Case "Open"
     TranslateIt = "Open"
   End Select
  Case "German"
   Select Case pstrStatement
    Case "Close"
     TranslateIt = "Ende"
    Case "Open"
     TranslateIt = "Offen"
   End Select
 End Select
End Function

Thus the above Close button would say Ende because Session("Language") is set to be German.

Perhaps a similar concept is used at Google where on the main screen one can click on Preferences and change the interface language to be something other than what you're used to.  Just for fun Google even lets you change it to be Elmer Fudd which is located in the listbox between Dutch and English.  With the interface language set to Elmer Fudd the "Google Search" button now says "Google Seawch" and the "I'm Feeling Lucky" button now says "I'm Feewing Wucky."

Best regards,
J. Paul Schmidt
www.Bullschmidt.com - Freelance ASP Web Developer
www.Bullschmidt.com/DevTip.asp - ASP Web Developer Tips

Back to Microsoft: ASP (Active Server Pages) FAQ Index
Back to Microsoft: ASP (Active Server Pages) Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close