F115: Create localization option in the OS.

Added error protection to the locale configuration.