I could see the voice actor learning a sentence or two but on occasion the bit goes on for a couple minutes. I feel like with a cartoon it wouldn’t be that hard to find a stand in who sounds close enough or use whoever does the dubbing for that language.
If it’s a character who is multilingual due to their ethnic background, they’ll often just cast an actor from that background. Making a movie full of latines who spend half the movie speaking Spanish? Hire latine actors.