At the beginning of the film, the protagonist goes on a journey, I think by boat, and before entering he sits next to some barbarians who would take him, and while they spoke he did not understand anything, but little by little he was capturing and understanding the language, then he commented something in their language. It was as if he had learned their language by listening only once.

I believe it was a period film.

Question is closed for new answers.
Selected answer as best