-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Ability to override methods in JsonStringLocalizer and JsonStringLocalizerFactory #42
Comments
This will may assist to fix #34 Could you please let me know what's the suggested changes that you like to made? |
For the
For the
I think these changes would make the library very flexible to extensions and customized changed for the users of the library. What do you think? Too much exposure? When it comes to adding support for changeable caching mechanism, what about adding a protected virtual method called Edit: forgot to add the |
FYI some of the method couldn't be override able, let us think from many perspectives and choose the proper methods to make them virtual with Why question Thanks for your suggestion |
I see, I can probably note the most important issues I have with extending the library at the moment:
I tried extending to implement my required fall back scenario, but was not able to (as I currently can't override any of the methods) and ended up having to copy the two classes and change them my self and add the line |
Do you have a repo for your fallback scenario? or I will provide a sample for such thing an probably I unit tests may be useful to ensure that nothing is broken |
No repo, sorry. But the only change I basically need after your PR #41 is just removing the line |
@thomkle I just created a sample in https://github.com/hishamco/My.Extensions.Localization.Json/tree/custom-localizer with minimal modification in the original Hope this fix your issue |
@thomkle I'd like to let you know I'm working on this now, but I need to from you what kind of extensibility do you need, I don't think adding |
Add this for now 0a48303 I will try to work on improving the |
It would be nice to be able to override methods in in
JsonStringLocalizer
andJsonStringLocalizerFactory
by making them virtual and at least using the protected modifier. E.g. if I'd like to change the functionality on how the cache is build, there is currently no way of overriding just that method (BuildResourcesCache
), I'd have to make a new localizer by copying the content fromJsonStringLocalizer
.Stumbled upon this when wanting to try to implement a temporary workaround to support the #39 functionality for the current release.
The text was updated successfully, but these errors were encountered: