Skip to content
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

Fix NullHtmlLocalizer for Core5 #7532

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public LocalizedString GetString(string name) =>
public LocalizedString GetString(string name, params object[] arguments) =>
NullStringLocalizerFactory.NullLocalizer.Instance.GetString(name, arguments);

IHtmlLocalizer IHtmlLocalizer.WithCulture(CultureInfo culture) => Instance;
[Obsolete("This method will be removed in the upcoming ASP.NET Core major release.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we need while the Localization APIs already warn about this. Second thing I'm not sure how this fix related to the referred issue, @agriffard is already fixed most if not issues in the PR #6999

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pr is not about moving to .Net Core 5 @hishamco - If you read the comments on the pr, it is about enabling usage of OrchardCore nugets in a solution targeting .Net Core 5.

@agriffard pr is about actually moving the target framework to .Net Core 5, which is a different thing.

I put the Obsolete in, although not required, so that when we move to .Net Core 5, we will catch it to remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pr is not about moving to .Net Core 5

Ya, but I'm not sure what's the issue if we didn't add this attribute?

Copy link
Contributor

@Skrypt Skrypt Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to warn those using it that they should stop using this method because it could be eventually removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm expected ASP.NET Core localization APIs will going to warn insted

public IHtmlLocalizer WithCulture(CultureInfo culture) => Instance;
}
}
}