We need to get translations from different sources, such as JSON files, databases, etc.
The current logic has the following limitations:
- It doesn't allow for the use of multiple implementations of the IResourcesProvider interface and choosing the appropriate one depending on the path.
- IResourcesProvider::TryGetResourceAsync supports only complex keys, which is a blocker for implementing some composite type for IResourcesProvider.
- IResourcesProvider is always registered in DI with a Singleton lifetime.
I would implement a solution using existing interfaces from the Microsoft.Extensions.Localization package. The current logic can be extended without breaking existing functionality.