Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ansar 181 posts 291 karma points
    Jan 07, 2012 @ 11:19
    Ansar
    0

    Progra,atically change locale (language) of a node

    I have two root nodes in my website.. one is set to English hostname and other is set to German..

    I need to change the German node's language to English in certain conditions..Is this possible and how?

    For example if some one comes to the german node using the URL

    http://mywebsite.de?lang=en

    I need to change the language of http://mywebsite.de to English..

    Thanks,
    Anz

  • Ansar 181 posts 291 karma points
    Jan 09, 2012 @ 06:42
    Ansar
    0

    Is there any help on this?

    I think I should setup an httpmodule for this.. but I am not quite sure how to go about that with Umbraco.. so any help from those who did something like this will be a great help.. also is it possible to read Node values (or Node domain) from httpmodule initialize cuture event?

  • Ansar 181 posts 291 karma points
    Jan 09, 2012 @ 10:09
    Ansar
    0

    I have done the following in HTTPModule and registered it in the web.config

    void context_PreRequestHandlerExecute(object sender, EventArgs e)
        {
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("de-CH");
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("de-CH");
        }

    I am sure this is getting executed but when I print the culture of a page from the Page_Load event, its again back to en-US as per the settings from "Managed Hostnames" .. Can anyone please help me with this,,

    Many Thanks,...

  • Ansar 181 posts 291 karma points
    Jan 09, 2012 @ 10:39
    Ansar
    0

    I have added the same question with better explanation here

    http://stackoverflow.com/questions/8786339/programatically-change-locale-language-of-a-page

    Please help :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies