-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource from different assembly #109
Comments
This is really more of a .NET question than an MvcSiteMapProvider question. If I understand correctly, this can be done by implementing your own resource provider. http://stackoverflow.com/questions/3395009/localization-of-web-sitemap-using-a-resx-file-in-other-project For now, I am marking this issue closed. Feel free to reopen it if you have any new information related to this topic. |
I wonder if anyone did this. Edit: |
Actually, I don't know the answer to your question because I have never implemented a resource provider myself, but this post may help. It looks like you just add the resource provider into the web.config file to get it working. If you prefer something more lightweight than Microsoft's extension point, you could implement IStringLocalizer and inject your implementation with DI. The downside to using the DisplayTemplates to do it is that you will have to add localization code in multiple places and any explicit usage of the ISiteMapNode instance won't be localized automatically. Besides the Title property, the Description, ImageUrl, and custom attributes are also localizable properties. |
I have posted a working example on StackOverflow of how to create a IStringLocalizer implementation that is based on Microsoft's ResourceManager extension point. It includes a sample of how you might use a resource from another assembly. It isn't the most extensible design - you can only use 1 assembly and 1 resource file - but it will work if that is all you need. |
FYI - I have opened a new issue #344 to gather requirements to address this issue better. Your feedback is appreciated. |
Hi,
Is there any way to access Resources for sitemap from different Project/assembly?
Thanks a lot for any advice.
The text was updated successfully, but these errors were encountered: