dotnet / dotnet/aspnetcore

Localization - async and CallerArgumentExpression

Open
#60,156 6 comments 3 reactions 0 assignees View on GitHub
area-mvc feature-localization
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

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.

Using async methods and provide arguments like ILogger does

### Describe the solution you'd like

Hi,
I just wonder why IStringLocalizer or IStringLocalizer< T > does not support async methods since getting translations is usually from filesystem or database and can be async.
But more importent, it would be great using CallerArgumentExpression for arguements.
Instead of providing a string like "My name is {0} and my age is {1}"
we could use "My name is {Name} and my age is {Age}" like Ilogger does.

Thank you all

### Additional context

(https://youtu.be/MHIheQ2_Yb4?t=324)

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.