Set locale only when defined