Where does K13's IPageRetriever detect the current culture from?

Rory Aherne asked on March 10, 2026 14:08

I sometimes have to use IPageRetriever outside my site's current context. I am able to get and set the expected culture so that LocalizationContext.CurrentCulture.CultureCode; returns the correct value.

However, IPageRetriever still reverts back to the default culture so I'm guessing it doesn't rely on LocalizationContext.CurrentCulture? If not, is there anything else I can set in my middleware to ensure the correct culture/context?

Or do I always have to use .Culture(currentCultureCode).CombineWithDefaultCulture(false) on my IPageRetriever methods?

Thanks,

Rory

Correct Answer

Juraj Ondrus answered on March 11, 2026 07:29

IPageRetriever gets the culture from the current context - which is usually set by the Thread.CurrentThread.CurrentCulture property

1 votesVote for this answer Unmark Correct answer

Recent Answers


Rory Aherne answered on March 11, 2026 10:13

That did the trick. Many thanks Juraj!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.