restored locale detection