First, I receive the materials, i.e., the film and the original script.
Then, at home, I prepare a Polish-language version of everything spoken in the production. I write down not only the dialogue by role, but also all the "reactions" — laughter, coughing, stammering, coughs, grunts, etc. I also mark all the short and long pauses.
As if that weren't enough, what I write must match the length of the lines and be reasonably synchronized with the characters' mouth movements as well as make the whole text culturally relevant and sensitive.