In addition to the example given by Valorum, there are several other examples that show that there is probably no simple magical way to understand different languages. At the Quidditch World Cup we find:
“Couldn’t do me a brew, I suppose? I’m keeping an eye out for Barty
Crouch. My Bulgarian opposite number’s making difficulties, and I
can’t understand a word he’s saying. Barty’ll be able to sort it out.
He speaks about a hundred and fifty languages.”
“Mr. Crouch?” said Percy, suddenly abandoning his look of poker-stiff
disapproval and positively writhing with excitement. “He speaks over
two hundred! Mermish and Gobbledegook and Troll ...”
“Anyone can speak Troll,” said Fred dismissively. “All you have to do
is point and grunt.”
From this we see that Ludo Bagman and his Bulgarian counterpart, both presumably full-fledged wizards, could not communicate without an interpreter. We also see that it is considered very impressive that Mr. Crouch can speak so many languages.
Later in Goblet of Fire when Bagman meets with the goblins we find:
“Absolute nightmare,” said Bagman to Harry in an undertone, noticing
Harry watching the goblins too. “Their English isn’t too good ...
it’s like being back with all the Bulgarians at the Quidditch World
Cup... but at least they used sign language another human could
recognize. This lot keep gabbling in Gobbledegook... and I only know
one word of Gobbledegook. Bladvak. It means ‘pickax.’ I don’t like
to use it in case they think I’m threatening them.”
When Harry reports this to Ron and Hermione, and they wonder why the goblins would have been looking for Mr. Crouch, Harry says:
“Crouch can speak loads of different languages, though,” said Harry.
“Maybe they need an interpreter.”
Of course, Harry might be completely wrong, and Bagman was probably lying, but this most likely again indicates that language translation/interpretation is not something that can be accomplished with a simple spell.
At the Second Task we find out that Dumbledore can speak and understand Mermish, and presumably the other people (including teachers, headmasters, and judges) can't:
Dumbledore was crouching at the water’s edge, deep in conversation
with what seemed to be the chief merperson, a particularly wild and
ferocious-looking female. He was making the same sort of screechy
noises that the merpeople made when they were above water; clearly,
Dumbledore could speak Mermish. Finally he straightened up, turned to
his fellow judges, and said, “A conference before we give the marks,
While it is possible that this is different because Mermish is not a human language, it seems once again that languages is a skill that cannot be simply replaced with magic.
However, at the end of Goblet of Fire Dumbledore issues an open invitation for the foreigners to return to Hogwarts:
“Every guest in this Hall,” said Dumbledore, and his eyes lingered
upon the Durmstrang students, “will be welcomed back here at any
time, should they wish to come. I say to you all, once again — in the
light of Lord Voldemort’s return, we are only as strong as we are
united, as weak as we are divided. Lord Voldemort’s gift for
spreading discord and enmity is very great. We can fight it only by
showing an equally strong bond of friendship and trust. Differences
of habit and language are nothing at all if our aims are identical
and our hearts are open.
The statement Differences of habit and language are nothing at all implies that it would not be too difficult to overcome a language barrier if necessary. While Dumbledore was not necessarily referring to them attending classes at Hogwarts, language is clearly not an insurmountable obstacle.
Thus, if there were students of different languages in the same school, there is probably no simple way to magically enable them to understand other languages, so they would probably either learn the main language of the school, or attend classes in their own language.