improved system locale detection