Copied to clipboard

Flag this post as spam?

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


  • Rotem Orbach 93 posts 506 karma points
    Apr 24, 2019 @ 15:16
    Rotem Orbach
    0

    Current culture for multi lanuguage

    Hi all, I have an issue with a multi language website. The CultureInfo.CurrentCulture returns OK (meaning, if i'm browsing the German website, I get de-DE).

    BUT, when I have to call an handler file (*.ashx), I get the site default language (umbracoDefaultUILanguage).

    Problem is, I need to get the current Culture, which is de-DE, but inside handler it's just does not work.

    Please help.

    Rotem

  • Dave Woestenborghs 3203 posts 10696 karma points MVP 4x admin c-trib
    Apr 24, 2019 @ 15:33
    Dave Woestenborghs
    0

    Hi Rotem,

    It's because your handler does not now about the current language. It is not tied to a umbraco page request.

    You will get the same issue when you have a web api method.

    What we do is pass the current culture to the api and set the culture of the current thread with that.

    Dave

  • Rotem Orbach 93 posts 506 karma points
    Apr 25, 2019 @ 06:29
    Rotem Orbach
    0

    Hi Dave, So what you are actually saying is that I have to pass a parameter to the handler?

  • Dave Woestenborghs 3203 posts 10696 karma points MVP 4x admin c-trib
    Apr 25, 2019 @ 06:32
    Dave Woestenborghs
    100

    Hi Rotem,

    That is exactly what I would do.

    Dave

  • Rotem Orbach 93 posts 506 karma points
    Apr 25, 2019 @ 06:43
    Rotem Orbach
    0

    Thank you very much Dave, I thought so too, but I wanted to be sure.

    Cheers :)

Please Sign in or register to post replies

Write your reply to:

Draft