How to display in any lanaguae

N

Navin

hi,
Guys.....
I am Making A website....in asp
Now my data is stored in Sql Server....
What i want is to display the Data as per Languaue the user selects..

The data stored in sql server is english

if the user selects French in asp site the data from the backend should be

displayed in FRench...

or based on ip address and location automatically the Data....sholud be

Displayed according to The REgional...settings..
ie guy logging on from japan sholud see data in japanense..
can this be done or what?
Please help me out...
regds,
Navin Mahindroo
 
M

martin

You will have to store the interpreted strings for each language in you
database.
when a user come to your site make the asp code deciede what are they are
from using IP address
(probabally earier to let then select a link on the home page so you know
you definatly have this right language..)
and then deciede which field to show, maybe using a case statement in your
sql server statement.

eg
create table tblGreeting
(
Greeting Id int identity(1,1),
NZMessage nvarchar(1000),
USMessage nvarchar(1000),
AustMessage nvarchar(1000),
JPNMessage nvarchar(1000)
)

insert into tblGreeting
(
'Welcome to my site -- why not visit NZ',
'Hello to you all in the Good old USA',
'G'day mate,' -- this is a long enough message for most of them :)
'don't know any japenese -- sorry..'
)

seriously,

maybe you will wnat to use PK and FK for the relationship and you can only
put about 8000 bytes of data on page in sql server.

HTH

martin.
 
B

Bullschmidt

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, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,087
Members
48,773
Latest member
Kaybee

Latest Threads

Top