Copied to clipboard

Flag this post as spam?

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


  • Patrick 23 posts 83 karma points
    Nov 13, 2013 @ 08:38
    Patrick
    0

    setting culture to read form a dictionary

    I have an Umbraco V4.10 website, which is multi-langual.

    Now I want to setup a comparison page, with multiple translations of a dictionary.
    So I want the value for the English translation next to the Dutch translation.

    Only problem is I can't seem to find how to read a value from a key in another culture then set.
    Is there a way to change the culture of to add the culture to the read function of getting the dictionary value?

    Greetz, Patrick

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 13, 2013 @ 16:21
    Fuji Kusaka
    0

    Hi Patrick,

    You could make use of Culture info to check the current culture of the page, depending on this page then display something.

     @using System.Globalization;
    
    @{
    Domain[] domains = umbraco.library.GetCurrentDomains(@Model.Id);
    var currentLanguage = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName.ToLower();
    if(!currentLanguage.Contains(Fr){ @umbraco.library.GetDictionaryItem("something"); }

        

     

  • 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