Opening up certain methods in LocalizationProvider that are useful for others.
See original GitHub issueMost of the code to access resource files is hidden because the methods are private. The public code revolves around retrieval of a localized resource and getting a “Compiled Resource File” meaning a dictionary of entries with best effort translated values for a given combination of resource file and locale.
I’d like to see the following methods become public:
-
Dictionary<string, string> GetResourceFile(string resourceFile)
This is one of the most basic methods in this class. It loads a given file and returns it as a dictionary. -
GetResourceFilename
Currently there are 2 overloads. I’d like to see the most complete one public. And the current ones are missing the “ResourceType” parameter which would tell it whether it should be a Host/Portal/None file. We should have a single complete entry point where any developer can get the correct resource file name given all parameters. So a new overload that takesstring resourceFileRoot, string language, PortalSettings portalSettings, CustomizedLocale resourceType
as parameters.
The use case: in several cases I’ve run into this when creating translation tools for DNN. It is frustrating to have to recreate the entire class because methods have been made private that were necessary for me to access.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
True. We had that discussion. I guess that discussion is in limbo while we discuss the bigger .net core issue. It is also a much bigger change. What I’d propose is to make these changes in the current library which ultimately gets replaced in the more distant future for a new approach if we decide to go that way.
This issue has been closed automatically due to the aforementioned detection of activity. Feel free to re-open the issue if you believe it should not be closed.