As some of the others have said, Woof, there weren't two versions of every scene. Each actor spoke in their own language, even if they didn't fully understand what each other was saying.
Sergio Leone did something similar in the "Spaghetti Westerns". It was an international cast. When filming, they took no sound crew along.
Instead, each actor spoke in his native language. Then, versions were over-dubbed later in the studio. Each version was in the language of whichever country the films were due to be released in.
In Scandinavia, mutual understandability depends on region. In Northern Sweden, towards the Norwegian border, their dialect is much nearer to that of the neighbouring Norwegians. Stockholmers, and those in the south in Skåne, can struggle to understand their northern countrymen.
Danish should be easily understood by Norwegians, (they were the same country once) but it isn't now. Germanic languages all of them, but Denmark historically had a great deal of cultural and trading dealings with The Dutch. That changed things around a bit.
If you'd like a good giggle, there are several youtubes where various Scandinavians try to understand what each other is saying in their own tongue.
The joke in Scandinavia is that Danish is simply Norwegian being spoken by a Swede.................... while drunk ;o)))