Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to do internationalization in classic ASP (w/o dynamic includes)?

Reply
Thread Tools

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

 
 
Emre Sevinc
Guest
Posts: n/a
 
      08-12-2004
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.
 
Reply With Quote
 
 
 
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      08-12-2004
> 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.)


 
Reply With Quote
 
 
 
 
Emre Sevinc
Guest
Posts: n/a
 
      08-16-2004
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]" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> > 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
ASP.NET Internationalization bug? Lee C. ASP .Net 31 08-13-2008 03:11 AM
Internationalization in ASP.NET Kiran A K ASP .Net 7 03-03-2006 01:52 PM
ASP.NET 2.0 Internationalization =?Utf-8?B?Z2FieW0=?= ASP .Net 0 06-23-2005 12:09 PM
ASP & Internationalization Jane Giles ASP General 0 09-24-2003 11:12 PM



Advertisments