In a module settings control I need to populate a DropDownList with the localized names of both standard and custom profile properties and in a GridView in a module edit control need to set a column heading to the localized name of the selected custom profile property. In DNN 4.7 to 4.9, I had this working well by pulling the localized profile property names from the base localization resx file of either:
"admin/Users/App_LocalResources/Profile.ascx.resx" for the standard profile properties or
"admin/Users/App_LocalResources/Profile.ascx.Portal-x.resx" for the custom profile properties of Portal x.
As I was testing this module against DNN 5.0 RC2 I found that the localization was broken with the change to a non-admin only user accounts/user management module. In DNN 5.0, the profile property resx files are located on the path:
"DesktopModules/Admin/Security/App_LocalResources/"
Although I could check DNN major version # and hard-code the paths, I'm reluctant to do so. The other possibility is to obtain the path from the ControlSrc field of one of the user accounts/user account module controls but I find that the ModuleName of the that module has changed from "User Account" in DNN 4.x to "Security" in DNN 5.0 - which unfortunately gets me back to a DNN major version # check again to obtain the ModuleName. I could lookup one of the module controls via the ModuleDefinitionName which is the same (UserAccount) in both DNN versions but a ModuleDefinitionName can be changed by the host.
Any suggestions as how best to handle this change? Am I missing an easier way to obtain this path or otherwise localize the profile property names?