How to universally set MacroResolver to use the current page's culture

Rory Aherne asked on May 8, 2025 17:25

My admin site is in English and my presentation site is multi lingual (german and english).

When I check on my presentation code for the german site LocalizationContext.CurrentCulture.CultureCode gives me "de-DE" as expected.

However, when I go to resolve a macro from content entered in the admin UI, I have to do this or the EvaluationContext in my custom macro methods has the CultureInfo from the UI (english)

@{
    var macroSettings = new MacroSettings
    {
        Culture = "de-de",
    };
}
@Html.Raw(MacroResolver.Resolve(Model.Content2, macroSettings))

Is there something I'm missing to not have to do this all the time? I'm on K13 core on the latest hotfix

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