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 .AddViewLocalization(options => options.ResourcesPath = "custom-dir") to Startup
Add a resource under custom-dir named Controllers.HomeController.resx and verify that the IHtmlLocalizer<HomeController> correctly works for App1.Controllers.HomeController.
Change the namespace for the controller to App2.Controllers.HomeController and see it fail to locate it.
Kinda obscure scenario I ran into when I tried copying the Controller from release verification to a different app.
Expected:
Perhaps an option to to specify the default namespace and for the resource to continue to be located.
The text was updated successfully, but these errors were encountered:
This is a documented edge case. If you're resource isn't in the main namespace for your project you must specify the entire namespace. So from your example Controllers.HomeController.resx would become App2.Controllers.HomeController.resx. We allow the base namespace to be left off the to prevent excessively long names or nested folders, but to prevent collisions you must specify the namespace of anything else.
How do you feel about that behavior? It's not my favorite thing, but I can't come up with any better solutions, so I'm open to input.
If you're resource isn't in the main namespace for your project you must specify the entire namespace.
I think in this case it was the inverse. The resource was in the base namespace, the controller (TType for IHtmlLocalizer<TType> ) wasn't. I think I might've spent less figuring out this issue if #258 is addressed.
Uh oh!
There was an error while loading. Please reload this page.
Steps:
.AddViewLocalization(options => options.ResourcesPath = "custom-dir")
to StartupControllers.HomeController.resx
and verify that theIHtmlLocalizer<HomeController>
correctly works forApp1.Controllers.HomeController
.App2.Controllers.HomeController
and see it fail to locate it.Kinda obscure scenario I ran into when I tried copying the Controller from release verification to a different app.
Expected:
Perhaps an option to to specify the default namespace and for the resource to continue to be located.
The text was updated successfully, but these errors were encountered: