Set locale efficiently