473,395 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

whats the best way to have multiple language asp pages?

Hello all,

any advice or links to pages about how to have multiple language asp
pages? For example, you have a database driven website that you want
customers around the world to use. How do you setup the asp pages so
that it is easy to change the text based on where the user is
connecting from?

Thanks,
Mike

Sep 14 '05 #1
1 2009
Mike,
any advice or links to pages about how to have multiple language asp
pages? For example, you have a database driven website that you want
customers around the world to use. How do you setup the asp pages so
that it is easy to change the text based on where the user is
connecting from?


There are several aspects to this. One of which is how/if you automatically
will determine the users locale (like much of microsoft.com does, for
instance), or if you will present a specific language and allow the user to
choose from other languages as he or she pleases. One other aspect is how to
present the correct information based on the users locale or choise. I'll
give you a few pointers on the latter part;

Normally when I start designing a multilanguage site, I start with paper and
pencil, and establish an overview of how the database needs to be designed.
The content and functionality of the site sets the boundaries for this. In a
very simplified version, let's say that the page's build, the layout,
positioning of images, etc. etc. are all done in the asp page. The only data
you store in the database (as far as this example goes, is the acctual text
(and, prehaps, some formatting) of the document. My table handling this
would look something like the following:

tblPages:
fldID, integer, identity, auto increment, no nulls, no duplicates (this
field is only needed if you require a unique identifier, or a primary key)
fldName, (var)char, [size according to preference], no nulls, allow
duplicates
fldContents, (var)char, [size according to preference],no nulls, allow
duplicates (not likely to have duplicates, but nevertheless)
fldLanguage, (var)char, [size according to preference (you should only need
two characters, but maybe the language name is more descriptive)], no nulls,
allow duplicates

That is a VERY simplified table, but it would do the trick. Now, using
whatever method you deem fitting, you either temporary (session variable) or
semi-permanently (cookie) store a variable determining the users prefered
language, or in the event that you need support for browsers/users that do
not allow for cookies, pass a variable with every page request. This
variable allows for filtering what content to provide in the asp page. The
SQL could look like

"SELECT fldContent FROM tblPages WHERE fldName = '" &
strNameOfContentYouRequest & "' AND fldLanguage = '" & strLanguageVariable &
"'"

Again, this is a gravely simplified query, it does not protect against SQL
injection, and so on. But I hope it gives the general idea. In the database
table, you might want to add colunms for createdDate, validFrom, validTo,
contentActive, and so on, depending on the complexity of the application.

HTH,

//Leif Beaton
Sep 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Nick | last post by:
In ASP you can create a variable that is accessible by all scripts in an application. Is this possible in PHP? Storing a multi-dimensional array in memory has much greater performance benefits...
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
9
by: Colum | last post by:
Hi, I am a complete newcommer to XML. I am planning to build a website with html, interacting with an Oracle db through Jsp. I want to use Xml, mainly because Ive heard about the kind of OO...
176
by: basecamp | last post by:
just checking the average age of programmers using this group -- thanks
5
by: Panama Red | last post by:
I would like to learn to program in c++ on Linux and AIX systems...mainly socket and fifo type stuff. Can someone recommend a book for someone with experience only with Perl, shell, and Pick/Basic...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
by: Guy Bradley | last post by:
write one function (for navigation) and call it in multiple asp.net pages? - i would use an include file as i do in asp but i gather this isnt the best way of doing it... suggestion? - thx in...
55
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.