Copied to clipboard

Flag this post as spam?

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


  • Laurent Lequenne 16 posts 36 karma points
    Feb 15, 2011 @ 12:08
    Laurent Lequenne
    0

    Multi domain languages website

    I already created multi domains or multilanguages site within umbraco without any problem. I m trying to figure out how to make a multi domain and languages site. As the master domain need to access the contents of the subsites I have to go in one single instance of umbraco, but I'm stuck with the hostnames. I tryed to play with the useDomainPrefixes settings, this enables umbraco to generated correct urls, but the pages becomes inaccessible, if not set, any url goes to the main site.

     

    Any Idea how can I achieve this ?

     

    Thanks

     

    Laurent Lequenne

  • Laurent Lequenne 16 posts 36 karma points
    Feb 15, 2011 @ 12:36
    Laurent Lequenne
    0

    Ok ! I have to set the hostnames on the root with some language, and then the hostnames for each language part.. .e.g.

    maes -> maes.dev.be
    maes/nl -> maes.dev.be/nl : dutch

  • Laurent Lequenne 16 posts 36 karma points
    Feb 15, 2011 @ 12:46
    Laurent Lequenne
    0

    False alert... It works for the Master site the three languages and the first language of any other site... maes/fr e.g. doesn't work with a hostname maes.dev.be/fr

  • Laurent Lequenne 16 posts 36 karma points
    Feb 15, 2011 @ 12:57
    Laurent Lequenne
    0

    Bon !!! It's definitely OK, I forgot to set some template :-)

  • Laurent Lequenne 16 posts 36 karma points
    Feb 15, 2011 @ 13:18
    Laurent Lequenne
    0

    Becomes boring that thing ! Really Boring ! Now the culture of Umbraco is not more set !!! WTF!

  • Laurent Lequenne 16 posts 36 karma points
    Feb 16, 2011 @ 09:22
    Laurent Lequenne
    0

    Oki, I found out there was no way, so I spent a lot if time to find out how to do something, while there is no way, and there is a bad documentation :-) So the way to go is to override the defaut umbraco page and change your culture on the initializeculture or preinit.

    As in my case the code will be:

    namespace VanRoey.Umbraco.Controls
    {
        public partial class _Default : umbraco.UmbracoDefault
        {

            protected override void OnPreInit(EventArgs e)
            {
                base.OnPreInit(e);

                SetCulture();
            }

            void SetCulture()
            {

                string[] p = this.Request.FilePath.Split(new char[] { '/' });

                if (p.Length > 1)
                {
                    switch (p[1].ToLower())
                    {
                        case "en":
                        case "en.aspx":
                            System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
                            break;
                        case "fr":
                        case "fr.aspx":
                            System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-BE");
                            break;
                        case "nl":
                        case "nl.aspx":
                            System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
                            break;
                    }
                }
            }

        }
    }

Please Sign in or register to post replies

Write your reply to:

Draft