When possible, according to many translators, it’s best to opt for the first method, as it ensures that your translation will be faithful to the source text.
However, there are a few other things that can get in the way, which is what makes translating swearwords so difficult. Translators must deal with censorship, and are sometimes must choose between translating the text as it is worded or adjusting it to reflect the speech patterns of the target language.
Translators generally agree that it is wrong to omit specific words based solely on ethical or moral grounds: The text itself is not targeted towards them (so they shouldn’t be offended by the language) and it is within their best interest to provide a faithful translation.
However, when the use of swearwords affects a translation’s flow, or when something written in Spanish or English — two languages in which swearwords are often used to express one’s emotions — is being translated into Japanese, a tongue that does not use the words as strongly, it sometimes makes sense to omit the swearwords in order to preserve the impact and purpose of the original text.