In some cases you can replace a pun with another pun that works in the target language.
In other cases, where you’re translating a religious text, doing something for scholarly reasons, or you otherwise think your audience would really like to know what’s going on in a text you have to add a translation note.
That’s why translation can be so hard, especially for poems, songs, comedy etc. Double meanings, metaphors, rhymes etc are often lost when translated.
In some cases you can replace a pun with another pun that works in the target language.
In other cases, where you’re translating a religious text, doing something for scholarly reasons, or you otherwise think your audience would really like to know what’s going on in a text you have to add a translation note.