Bilingual Site. Best practices

J

jobs

I have an English site I need to make available in Spanish. Ideally
there will be a preset switch in the users profile to indicate they
would like to see the site in Spanish.

My first inclination is to make a copy of the site redirect them after
the login.

Outside of doing it this way, or purchasing/using third party
products or controls that deal with localization and maybe use xml to
drive those controls dynamically. Is their an easy way to handle this
in native asp.net 2.0?

As a simple example, say I have a bunch of asp:Labels with hard coded
text= properties in my markup. Is the technique to basically set these
in the codebhind based on the selected language? Is that the typical
and expected route? If so, sound kinda painful and I'd almost rather
maintain a separate site.

Thanks for any help or information.
 
J

jobs

Nice! I just did a simple vb.net asp.net project to test it. And do
see it using the generated resx file over fixed values on my markup.


Dumb question, I made a copy of the that as resx file .. called it
NEW.aspx.resx file under the App_LocalResources folder. Now how do I
get my site to use the alternative resx file? I won't be using the
browser setting to drive which language will be used. I will want to
control that from a setting in the users profile.

Also, where would be a place to make that switch? any chance I could
make it only once and it would stay set for the duration of the
session for all pages called by that session? or will each page's
codebehind have to check for that and set it?


Thanks in advance!
 
J

Juan T. Llibre

re:
!> how do I get my site to use the alternative resx file?

http://www.codeproject.com/useritems/ASPGlobalization.asp

!> I won't be using the browser setting to drive which language will be used.
!> I will want to control that from a setting in the users profile.

Globalization natively uses the browser setting to determine which resx file to use.

To do it the way you want to, you'll need to use a different method.

Many people save the language translations in different database columns,
and have the user select ( or make it a profile option ) the language desired.
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top