Correct way to detect file language