DNN-6204 Fix to localization code in PortalController

Isolated locale code from portal controller to new localization extensions class and repaired flawed code