Foreign languages

How did people study foreign languages before the 19th century?