It may be different for books, but I am convinced there is a growing industry of expertise in doing this very sort of thing for video. For a fascinating look into the mechanics behind this, go to the shelf in your house where you keep your DVD collection, pick any DVD that contains 'multiple language' tracks, and select any scene that deals with language, cultural 'in-jokes' or puns, and then watch that scene in a language other than English.
Often you do not even have to understand the 'foreign language' to get insight into the very clever and revealing tricks used to 'localize' the content.
This became apparent to me while I had a whim to watch a particular family guy episode on DVD in Spanish instead of English. There is a scene where one of the main characters is humiliated when all of the people in her school (including the janitor) reveal that she is the only one who doesn't have plans for spring break.
The "English" version of the joke uses a punchline with the speaker switching from speaking English into speaking Spanish (to get the attention of the janitor). The "Spanish" version of the joke uses a punchline with the speaker switching from speaking Spanish into speaking (Gibberish that appears to have a 'Far East' accent to it?).
One could write an entire book on the underlying cultural dynamics and implications. I wonder what it would be like if you substituted "Perl" for "English" and "Java" for "Spanish" ...