Locale detection and setting