diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs index d429b3a29e8..70ab899ec22 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs @@ -26,7 +26,7 @@ public override bool Equals(FluidValue other) public override object ToObjectValue() => ToStringValue(); - public override string ToStringValue() => _culture.Name; + public override string ToStringValue() => CultureInfo.CurrentUICulture.Name; #pragma warning disable CS0672 // Member overrides obsolete member public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) @@ -34,7 +34,7 @@ public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo => writer.Write(ToStringValue()); public async override ValueTask WriteToAsync(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) - => await writer.WriteAsync(ToStringValue()); + => await writer.WriteAsync(CultureInfo.CurrentUICulture.Name); protected override FluidValue GetValue(string name, TemplateContext context) => name switch