Refactor locale configuration.