Taken from the included link: "This phrase, in which French refers to "bad language", is employed when the speaker feels compelled to use an obscenity despite having listeners who might be offended.  It's a late 19th century euphemism which first appeared in Harper's Magazine in 1895.\n\nIt is thought that the term French is employed in this sense as it already had a history of association with things considered vulgar.  As far back as the early 16th century, French pox and the French disease were synonyms for genital herpes, and French-sick was another term for syphillis.  The OED also equates the adjective French with "spiciness", as in French letter for "condom", French kiss (1923) and French (i. e. "sexually explicit") novels (from 1749)."
Why do people say 'pardon my french' when they cuss?