How to do internationalization in classic ASP (w/o dynamic includes)?

Discussion in 'ASP General' started by Emre Sevinc, Aug 12, 2004.

  1. Emre Sevinc

    Emre Sevinc Guest

    I'm using classical ASP on IIS 6.0 (Windows 2003 Server). What I want
    to do is to serve the same pages in two different languages without
    using two different folders and doubling my same ASP code and changing
    the string values.

    What I need is DYNAMIC INCLUDE functionality similar to PHP, however I
    know that I don't have it in ASP. Moreover Server.Execute is useless
    because it doesn't have a functionality like an include file, calling
    some file (that includes language string constants) conditionally is
    not useful because when the file is executed its scope is over and I
    cannot reach the constants or variables defined in that file.

    What do you advise in such a situation? I need two groups of
    constants, one for English, one for Turkish, like:

    english.asp
    ---------------
    lngWeek = "Week"
    lngEdit = "Edit"
    lngSubmit = "Submit"
    ..
    ..
    ..


    turkish.asp
    ---------------
    lngWeek = "Hafta"
    lngEdit = "Düzenle"
    lngSubmit = "Gönder"
    ..
    ..
    ..


    and use the same constant throughout my other ASP pages. Now, you may
    advise me to use database, yes I can store the data above in a
    database but everytime an ASP page is rendered a connection must be
    opened to database and I need loops (imagine I more than a few hundred
    string constatns) and control structures. The performance penalty
    scares me.

    How can such a system be implemented in classical ASP?

    Thanks in advance.
     
    Emre Sevinc, Aug 12, 2004
    #1
    1. Advertising

  2. > What I need is DYNAMIC INCLUDE functionality similar to PHP, however I
    > know that I don't have it in ASP.


    Have you seen http://www.aspfaq.com/2042 ?

    You could also store your constants in a database table with three columns:
    ConstantName, EnglishValue, TurkishValue, and then have a stored procedure
    or function that takes your current locale as a parameter and returns the
    constants as a single resultset or as output parameters. You really
    shouldn't be so scared of making minimal calls to a database if it makes
    your job easier. With the hardware we're using these days, it's not as
    sacreligious as it used to be. I would bet that a large percentage of the
    web sites you go to use the database not just for constants but for all of
    the content as well, and the only ones that are slow are the ones that are
    on a single node, old compaq server with 256 MB of RAM, using Access and
    trying to serve 8 billion pages an hour (e.g. friendster.com). Anyway, you
    should test the performance of a database solution, instead of just writing
    it off based on assumptions and fear.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)
     
    Aaron [SQL Server MVP], Aug 12, 2004
    #2
    1. Advertising

  3. Emre Sevinc

    Emre Sevinc Guest

    Thanks for the advice. We did a simple test and saw that it took about
    roughly 55 seconds to make 3500 calls to SQL Server from within an ASP
    page. This calculation let us to decide and we decided to use database
    for storing our multilingual string constants.

    "Aaron [SQL Server MVP]" <> wrote in message news:<#>...
    > > What I need is DYNAMIC INCLUDE functionality similar to PHP, however I
    > > know that I don't have it in ASP.

    >
    > Have you seen http://www.aspfaq.com/2042 ?
    >
    > shouldn't be so scared of making minimal calls to a database if it makes
    > your job easier. With the hardware we're using these days, it's not as
    > sacreligious as it used to be. I would bet that a large percentage of the
    > web sites you go to use the database not just for constants but for all of
    > the content as well, and the only ones that are slow are the ones that are
    > on a single node, old compaq server with 256 MB of RAM, using Access and
    > trying to serve 8 billion pages an hour (e.g. friendster.com). Anyway, you
    > should test the performance of a database solution, instead of just writing
    > it off based on assumptions and fear.
     
    Emre Sevinc, Aug 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Achim Domma (SyynX Solutions GmbH)

    dynamic includes for different designs

    Achim Domma (SyynX Solutions GmbH), Jan 17, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    Achim Domma (SyynX Solutions GmbH)
    Jan 17, 2006
  2. Ajinkya

    Dynamic includes/linking

    Ajinkya, Sep 28, 2007, in forum: C Programming
    Replies:
    7
    Views:
    349
    Mark McIntyre
    Sep 29, 2007
  3. jason
    Replies:
    2
    Views:
    115
    jason
    Jul 2, 2003
  4. Gary Contois

    dynamic includes of asp code

    Gary Contois, Sep 19, 2003, in forum: ASP General
    Replies:
    4
    Views:
    161
    Evertjan.
    Sep 19, 2003
  5. MyndPhlyp
    Replies:
    7
    Views:
    214
    Chris Hohmann
    Oct 27, 2005
Loading...

Share This Page