classic asp

Posted on 2012-09-20
Last Modified: 2012-09-20
Hello Experts,

I have a website having 5 webpages, I want to give users the facility to convert these pages to spanish language whenever they want i.e website in two language.

Can I do this in classic ASP?  if yes can you provide some guidelines so that I can achieve it.

Question by:Dinesh Kumar
    LVL 36

    Accepted Solution


    Author Comment

    by:Dinesh Kumar
    I think I can use XML to store language specific content as XML is much faster than Database.

    It would be better if you can tell me how to parse the JSON in asp which is lightweight and parsing should be easy in it.
    LVL 52

    Assisted Solution

    by:Scott Fell, EE MVE
    An easy option is to simply use google translate

    Another option is to have separate pages for spanish.  Normally, this may not be the best solution but you have a small number of pages.  If somebody clicks to see the site in spanish then they will be taken to the spanish home page.  The plus side of this gives you control of everything including images and layout.

    The next option is to make your outer layout into a template and use include files for the content.  If english in chosen, then include english content, if spanish is chosen, include spanish.  

    You will make one file called ePage1Main.asp for your english content.  It only needs the html markup for the content.  And another for ePage1SideBar.asp for a side bar content.  Then do the same for sPage1Main.asp and sPage1SideBar.asp for the spanish version.

    Then create a template like below
    if request.form("language")<>"" then
         ' value e for english; s for spanish
    end if
    <title>My site</title>
    <!--#include virtual=<%=language%>"Page1Main.asp"-->
    <!--#include virtual=<%=language%>"Page1SideBar.asp"-->

    Open in new window

    This works in the similar was as if you used json except the include file places the content directly on the just as if you hard coded it.  With json or xml, you still need to call it.  If you are worried about speed, this is the fastest.

    If you still want to use a json file.  Check out  I used this a lot and works great.
    LVL 18

    Expert Comment

    Do you want to literally translate the page on the fly or do you want to have two versions of the page and serve up the appropriate language's content?

    If you will have the content pre-translated, you may want to place the content in your HTML into two separate DIVs and merely display the DIV that contains the user's preferred language.

    For example,
    If the page defaults to English and it has a "En Espanol" link/button, you run some simple javascript that hides the <div id="english"> and displays the <div id="spanish">
    function swapLangauge(lang) {
      if (lang=='spanish'){
        document.getElementById('english').style.display = 'none';
        document.getElementById('spanish').style.display = 'block';
      } else {
        document.getElementById('spanish').style.display = 'none';
        document.getElementById('english').style.display = 'block';

    Open in new window


    Author Closing Comment

    by:Dinesh Kumar

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    746 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

    17 Experts available now in Live!

    Get 1:1 Help Now