You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
Add the ability to configure the ResourceManagerStringLocalizer so that if a given resource name is not found it throws, rather than returning the key itself. This effectively makes it behave like the underlying ResourceManager API itself.
e.g.
public enum ResourceLookupBehavior
{
UseNameIfNotFound,
ThrowIfNotFound
}
public class ResourceManagerStringLocalizerFactory...
{
...
public ResourceLookupBehavior ResourceLookupBehavior { get; set; } = ResourceLookupBehavior.UseNameIfNotFound;
...
}
The text was updated successfully, but these errors were encountered:
This could be used by other implementations of IStringLocalizer, so you might consider making it more generic (f.e. LookupBehavior / StringLookupBehavior / LocalizedStringLookupBehavior).
…Localizer
- Added the ResourceLookupBehavior enum
- Using it into the LocalizationOptions
- Added it to the ResourceMangerStringLocalizer
- Refactored all the automatic fallbacks to the resource name (now use a
single method)
- Added unit tests for both specific behaviors
Addresses aspnet#13
If you could make it act like MVC does when it can't find a view - that is, MVC will list the folders searched, that would really help debug.
An unhandled exception occurred while processing the request. InvalidOperationException: The view 'About' was not found. The following locations were searched: /Views/Home/About.cshtml /Views/Shared/About.cshtml.
Add the ability to configure the
ResourceManagerStringLocalizer
so that if a given resource name is not found it throws, rather than returning the key itself. This effectively makes it behave like the underlyingResourceManager
API itself.e.g.
The text was updated successfully, but these errors were encountered: