Refactor set_locale in application controller