Implemented locale changing on login page

Code refactoring
Fixed error message when changing locale