-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Liquid Culture accessor #16956
base: main
Are you sure you want to change the base?
Conversation
src/OrchardCore/OrchardCore.DisplayManagement.Liquid/LiquidCultureAccessor.cs
Show resolved
Hide resolved
|
||
public override string ToStringValue() => _culture.Name; | ||
|
||
public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WriteToAsync
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote another PR while you writing comments :)
|
||
public override bool Equals(FluidValue other) | ||
{ | ||
throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe compare string representation with culture code? In case someone does Culture == 'en-US'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test it though, not sure when Equals
is invoked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test it though, not sure when Equals is invoked
I can write a unit test, but I'm not sure when it called either :)
src/OrchardCore/OrchardCore.DisplayManagement.Liquid/Values/CultureValue.cs
Outdated
Show resolved
Hide resolved
…ltureValue.cs Co-authored-by: Sébastien Ros <[email protected]>
Fixes #16957