Renamed _detect_lang to detect_lang