Copied to clipboard

Flag this post as spam?

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


  • dominik 711 posts 733 karma points
    Mar 10, 2014 @ 11:36
    dominik
    0

    dictonary translation issues on classical c# usercontrols

    Hello,

    I am facing the following issues.

    I have a multi language website (english and german) and if i try to use "umbraco.library.GetDictionaryItem("CreateAccount")" in a c# usercontrol it is always shown in english.

    If i do the same in a razor syntax "@Dictionary["CreateAccount"]" everything is working fine and text is translated into german

    Any idea why this happening?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 10, 2014 @ 12:07
    Jeroen Breuer
    0

    Hello,

    What version of Umbraco are you using?

    If you have the Umbraco Helper available you could do this:

    Umbraco.GetDictionaryValue("CreateAccount")

    Try if that might work.

    Jeroen

  • dominik 711 posts 733 karma points
    Mar 10, 2014 @ 12:27
    dominik
    0

    hi Jeroen,


    We upgraded from 4.7.2 to 6.1.6

    But why the Razor syntax behaves different as the umbraco.library syntax?

     

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 10, 2014 @ 12:31
    Jeroen Breuer
    0

    I don't really know. They should do to same. Maybe check what the culture is in Razor and in the UC. Maybe somehow that is different.

    Jeroen

  • dominik 711 posts 733 karma points
    Mar 12, 2014 @ 07:56
    dominik
    0

    HI Jeroen,

    Is razor and a c# usercontrol using different culture settings? I am wondering as on the same page the razor syntax is translating the item while c# control is always showing it as English.

    Is there any reason for this?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 12, 2014 @ 09:45
    Jeroen Breuer
    0

    Hello,

    No they should use the same culture settings. You can check the current culture with this code:

    System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft