Refactored set_default_locale into one function