added locale detection