-
Notifications
You must be signed in to change notification settings - Fork 65
Decouple StringLocalizer / HtmlLocalizer from types to make Shared Resources possible #227
Comments
This is also related to: dotnet/aspnetcore#1142 |
You call the second overload. There are two levels of keys here to allow for flexibility in implementation.
With this information you then get back an Any implementation of For example, an implementation that looks up strings from files might use the
|
If you were more specifically asking how this would work given the default (and only) implementation of |
Thanks Damian! Mate, good luck with all these changes you guys are making with Core etc. Really looking forward to RC2! :-) |
@JoeOM thanks! I'm really looking forward to getting it in people's hands finally soon. |
Seems like @JoeOM got his answer, closing this one out. |
Hi
On Dec 15 2015 DamianEdwards commented on #153
"You absolutely can get a resource of any name you like by using the IStringLocalizerFactory type directly. The IStringLocalizer is simply a convenience type that is opinionated about where it looks for resources (namely, it uses the name of the type T ). Same applies for IHtmlLocalizerFactory and IHtmlLocalizer . Also, IViewLocalizer is similar to the " T " types in that it's simply an opinionated way to find resources, in this case by using the view file's project relative path.
To do it manually:"
However the IStringLocalizerFactory does not support Create("Use.Whatever.Name.Here.You.Like").
The interface is as follows:
Please explain to me how the code presented as an example from DamianEdwards would work if the interface does not even support just strings but instead requires a Type?
The text was updated successfully, but these errors were encountered: