Copied to clipboard

Flag this post as spam?

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

  • René 327 posts 852 karma points
    Mar 24, 2015 @ 14:27


    Thanks for a great project, Vorto, it looks great.. 

    Unbraco version 7.2

    One question.. I can not see how to change the language. 

    I need to have a dropdown list to change the language.
    I have been searching for som documentation for this.

    Site structure:

    Main page

    Hostnames set on the main page




    Is there any who have a hint on how this is managed. Or maybe i´m missing something :-)


  • Dennis Aaen 4459 posts 17972 karma points admin hq c-trib
    Mar 24, 2015 @ 14:34
    Dennis Aaen

    Hi René,

    Try to see this epsiode of uHangout, where the creator of the package is explains how the package works, and to configure it.

    Hope this helps,


  • René 327 posts 852 karma points
    Jul 15, 2015 @ 17:36


    I have made a very simple language switcher, just for testing.

    enter image description here

    Damn editor Here is an image of the code:

    enter image description here

    This is from the master:

    Layout = null;
    var root = Model.Content.AncestorOrSelf(2).Children;
    var domains = Domain.GetDomains();
    var arrDomains = domains as Domain[] ?? domains.ToArray();}


    @Language switch@

    @if (arrDomains.Any()) { foreach (var domain in arrDomains) { var currentPage = Model.Content.Url.TrimStart("/" + Culture); var url = domain.Name + currentPage; @domain.Language.FriendlyName } }


    The result:

    The result

  • Denford 130 posts 311 karma points
    Jul 20, 2015 @ 16:01

    Not cure if you got any answer for this yet, but for anyone who need this just been building my own logic for it so;

    1) dropdown list with all languages using umbraco.cms.businesslogic.language.Language.GetAllAsList()

    2) set a cookie with the language when this changes

    3) get the language from the cookie and get the value from the vorto call with the extra overlaod of the language e.g. Model.Content.GetVortoValue("yourVortoAlias", "cookieLanguage")

    just got this last step in my own custom class so that i cna set any defaults if that language has got no values.

  • Amir Khan 1230 posts 2604 karma points
    Aug 31, 2015 @ 17:06
    Amir Khan

    Is there a complete example of this somewhere? I can't seem to figure out how to build a simple language picker for Vorto...



  • Amir Khan 1230 posts 2604 karma points
    Sep 11, 2015 @ 19:24
    Amir Khan

    In case anyone is looking:

                    @foreach(var lang in umbraco.cms.businesslogic.language.Language.GetAllAsList())
                        var currentCulture = @System.Globalization.CultureInfo.CurrentCulture.Name;
                        var currentPage = Model.Content.Url.TrimStart("/" + @currentCulture);
                        var url = "/" + @lang.CultureAlias + currentPage;
                        <li><a href="@url">@url, @lang.CultureAlias, @lang.FriendlyName</a></li>
  • René 327 posts 852 karma points
    Jun 15, 2017 @ 21:14

    HI If anyone can use this.

     @foreach(var lang in ApplicationContext.Current.Services.LocalizationService.GetAllLanguages().ToList())
        var currentCulture = System.Globalization.CultureInfo.CurrentCulture.Name;
        var currentPage = Model.Content.Url.TrimStart("/" + @currentCulture);
        var url = "/" + lang.CultureInfo.TwoLetterISOLanguageName + currentPage;
        <li><a href="@url">@url, @lang.CultureName, @lang.CultureInfo.DisplayName</a></li>
Please Sign in or register to post replies

Write your reply to: