dotnet / dotnet/aspnetcore

Async Support for Localization APIs

Open
#65,498 8 comments 0 reactions 0 assignees View on GitHub
area-middleware feature-localization
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

_No response_

### Describe the solution you'd like

@DamianEdwards, as we know from the DNX days, the localization APIs rely on RESX. During my journey in localization, some situations force you to grab the data from the underlying storage that is IO blocking. We usually use `GetAwaiter().GetResult()` or use sync version if it's there

https://github.com/aspnet/Entropy/blob/master/samples/Localization.EntityFramework/EFStringLocalizer.cs

https://github.com/hishamco/My.Extensions.Localization.Json/blob/main/src/My.Extensions.Localization.Json/JsonStringLocalizer.cs

The above are a few use cases that I did a long time ago. Also, we face similar issues in Orchard Core, so is there a plan to support asynchrony with `ValueTask`

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.