Template changing depending on viewer's language -is it avaliable?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anos atrás
Hi!
I want to build the site with hebrew and english lanuages. Hebrew direction is rtl. Is it possible the site will be cange the masterpage to one with NAVBAR on left after user chose "English" in the combo on the main page?
13 anos atrás
I see that nobody can help me ,so i will help to my self and may be to some ather peaple that experiencing same problem..

Lets explain it again: i need site to be in english and in hebrew. Hebrew direction is right to left, so i need to switch the master page with navigation links on the right.  

so i added to site masterpage named TwoColumn_Heb.Master and Theme with some RightToLeft css that connected to this masterPage.
Now to sitwch the masterPage in response of Language DropDownList
i added this code to Libraries\Nop.HttpModules.MembershipModule\MembershipHttpModule.cs


        void page_PreInit(object sender, EventArgs e)
        {
            Page page = sender as Page;
            if (page != null)
            {
                int lang = CommonHelper.GetCookieInt("Nop.CustomerLanguage");



                if (page.MasterPageFile == "/MasterPages/TwoColumn.master")
                {
                    switch (lang)
                    {

                        case 7:
                            page.MasterPageFile = "~/MasterPages/TwoColumn.master";
                            break;
                        case 8:
                            page.MasterPageFile = "~/MasterPages/TwoColumn_Heb.master";
                            break;

                    }
                }

            }
        }
13 anos atrás
I forgot :
Also you need to add


 
       void context_PreRequestHandlerExecute(object sender, EventArgs e)
        {
            Page page = HttpContext.Current.CurrentHandler as Page;
            if (page != null)
            {
                page.PreInit += new EventHandler(page_PreInit);
            }
        }

And inside Init to add the folowing


application.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);


Now, lets face it- I'm not expert programmer, and i assume tere is more elegant solutions so objections and corrections to that i have done are welcomed.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.