Last post Jan 30, 2008 03:12 PM by admalreddy
Jan 29, 2008 06:45 AM|Werox|LINK
Jan 29, 2008 04:34 PM|Motley|LINK
Why would you ever want to do that? That's not really localizing a site, that's making separate copies of everything for every different language.
You might consider using something like a custom redirect module so that the URL appears that way, but when you call for example mysite.com/en-us/default.aspx, it actually goes to mysite.com/default.aspx?lang=en-us instead. That way all or designs are centralized
and you can localize your text using the resource provider of your choice.
Jan 30, 2008 02:16 AM|Werox|LINK
Jan 30, 2008 03:12 PM|admalreddy|LINK
Theoretically thats not the best approach because it would seemingly defeat the entire purpose of localizing.
That said, if you are still insistent on doing it the way you described...here's how:
Visual Studio 2003 and before:
Make your pages (aspx) and name them appropriately. Based on the Culture (say es-US) you could load a control UserLogin.ascx from a separate folder called es-US. If the culture were fr-CA, then you would load a control with the same name UserLogin.ascx from
a folder called fr-CA. All this time you would load these controls into the same page UserLogin.aspx.
Remember to extract the business logic out of the controls and put them in a class so that it is not duplicated across all those controls.
The above is a lot of trouble, but if thats what you really want to do, then you could do it.
Apply the same principle to master pages and child pages instead of Pages and user Controls respectively and you'll have the same desired results.