I've been looking into building a simple multilingual website using
Umbraco. The main point is that I would not want to have different
folders and pages for different languages. I am looking for the
equivalent of what we can have in a basic .NET web application: unique
web pages pages and several resource files (*.resx), where the pages
contain keys, whose values can be determined at runtime dependening on
the language the user chooses to view the application in.
So I could put the language selector in the master page? What is the
recommended approach? I've been searching about this topic, and found
lots of references to the broken link: http://our.umbraco.org/books/multilingual-11-sites ... It would be nice
to read a bit about this topic before proceeding... If any one can
provide me with any advice or references, I'd appreaciate it a lot.
Thank you Sherry for your suggestion and for sharing your code.
I ended up with a somewhat different appoach, an http module, but still used the cookies! I wasn't being able to get a compiled App_global.asax.dll (just the Global.asax) to replace the original one, so I ended up looking into Http Handlers and Http Modules, and created an Http Module with the cookie code in the Application_BeginRequestion function:
private void Application_BeginRequest(Object source, EventArgs e) { HttpCookie cookie = new HttpCookie("lang"); if (Request.Cookies["lang"] != null) { cookie = Request.Cookies["lang"]; Thread.CurrentThread.CurrentUICulture = new CultureInfo(cookie.Value); Thread.CurrentThread.CurrentCulture = new CultureInfo(cookie.Value); } }
Any advantages or disadvantages to one or other approach? So far it's working. Thanks!
Create a multilingual site using Umbraco
Hello,
I've been looking into building a simple multilingual website using Umbraco. The main point is that I would not want to have different folders and pages for different languages. I am looking for the equivalent of what we can have in a basic .NET web application: unique web pages pages and several resource files (*.resx), where the pages contain keys, whose values can be determined at runtime dependening on the language the user chooses to view the application in.
I have already followed the video tutorial:
http://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/using-net-user-controls
So I know the resource files can be used... I just need a language selector, say a drop down list... I actually tried to make such a user control and add it side by side to my HelloWorld user control, but didn't work, as we cannot change the application's culture using a user control:
http://stackoverflow.com/questions/3209105/asp-net-changing-a-sites-culture-programmatically
http://stackoverflow.com/questions/4876520/programmatically-set-culture-of-user-controls-in-asp-net
So I could put the language selector in the master page? What is the recommended approach? I've been searching about this topic, and found lots of references to the broken link:
http://our.umbraco.org/books/multilingual-11-sites ... It would be nice to read a bit about this topic before proceeding... If any one can provide me with any advice or references, I'd appreaciate it a lot.
Thanks in advance.
I use a global.asax to change the culture
And then delete the one used by umbraco.
Thank you Sherry for your suggestion and for sharing your code.
I ended up with a somewhat different appoach, an http module, but still used the cookies! I wasn't being able to get a compiled App_global.asax.dll (just the Global.asax) to replace the original one, so I ended up looking into Http Handlers and Http Modules, and created an Http Module with the cookie code in the Application_BeginRequestion function:
Any advantages or disadvantages to one or other approach? So far it's working. Thanks!
is working on a reply...