make language detection optional (closes #779)