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.
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
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
Hi Dave, So what you are actually saying is that I have to pass a parameter to the handler?
Hi Rotem,
That is exactly what I would do.
Dave
Thank you very much Dave, I thought so too, but I wanted to be sure.
Cheers :)
is working on a reply...