Translation suffers from many inherent limitations and frustrations, one of which is rendering a pun meaningfully in another language. Harry Potter is filled with wonderful wordplay and so provides a lot of good examples for a translator to consider and learn from.
A well-worn pun is a yawn, but a clever cleavage of meaning to create irony or humor is always appreciated. I look for, and even collect great puns, and am always surprised by how readily new ones appear. Even the scientific papers I work on as a translator occasionally have a pun in them.
So how do you translate a pun? Although there is, obviously, no one solution to this problem, there are strategies and tricks that help. You can hope for a happy coincidence between your source and target languages, unlikely though this is; you can find a close alternative, which sometimes is obvious but often requires considerable thought; or you can recreate the entire pun in a separate fashion, which requires a lot of effort and may fail. To provide examples of various puns and these solutions, I dip into the linguistic treasure trove of the world of Harry Potter. I've read all the stories in English, and at least one book if not several in Japanese, Spanish, French, German, Chinese, and Latin, and I take my examples from these.
In English version of Harry Potter and the Goblet of Fire, a classmate of Harry's, Lavender Brown, says she has found Uranus in her horoscope, to which Ron Weasley asks: "Can I have a look at Uranus too, Lavender?" (p. 201), evoking the usual pun in English amongst children. An identical or similar pun does exist in some languages, and not surprisingly, languages that share their history with English more readily reproduce the pun.
In German, "Uranus" is the name of the planet Uranus, and also puns nicely, though perhaps not as famously as in English. This is not entirely surprising, given how closely related English and German are. It also means the translator got lucky, insofar as such happy coincidences are few and far between for puns, word play, and other linguistic legerdemain.
For the French reader, a similar astronomical pun is available with the word "lune" (moon), and in French version of this book, when Lavende (the French version of Lavender’s name) is told: "C'est la Lune, ma chérie," by Professor Trelawney, Ron then asks: "Est-ce que je pourrais voir ta lune, Lavande?" The word "lune" is often used in French slang to refer to the buttocks, presumably because of the similarity between the shape of a butt cheek and that of a crescent moon. We in English recognize this similarity in our use of the verb "to moon" to refer to exposing both cheeks in a gesture of defiance, protest, or insult. The translator changed the heavenly body in question to create a similar pun for the human body.
In Spanish, the translator gives us: "Puedo echarle yo también un vistazo a tu Ur-ano, Lavender? - preguntó Ron con sorna. The word "ano" of course means "anus"; with the "Ur" separated to preserve the pun. By itself "ur" has no particular meaning in Spanish, so the hyphen plays an important part in recreating the wordplay.
All of this falls apart in Japanese, not surprisingly. The language has numerous words to refer to the rear end, from the delicately indirect to the scatalogically specific. Unfortunately, none of them sounds remotely similar to the word for the planet Uranus, which is "meiosei," a word that has no possibility for a proctologic pun. The translator is left with no good choices, and so alters the text a bit by adding the phrase "saikobi" meaning the tail, stern, or rearmost of a group to the word for Uranus. This flows into Ron saying "donketsu no hoshi ka" (a final/last/butt of a star), which through typographic emphasis on the "ketsu" part of "donketsu" creates the proctological pun (ketsu is standard slang for this body part in Japanese). A lot of work, but successful, if a bit forced.
So a pun can be reproduced, but often with considerable twisting of the text. And still something is lost: Ron Weasly's childish choice of words to direct at someone he doesn't particularly like doesn't quite appear in the other languages. After all, the "Uranu" pun in English is old, already well-worn when I was growing up. Similar puns that combine the proctologic and astrologic exist in some languages, but may not convey this connotative meaning that shows us more about Ron's character.
George Borrow said: "Translation is at best an echo." Sometimes the echo is loud and clear, leaving little doubt as to what the original was doing. At other times, however, the echo is distant and vague, representing a weak imitation of the source text. This is not necessarily the translator's fault. As some geography is better suited to producing clear reverberations, some language pairs make reproducing puns easier.