Make setting locale conditional