Green’s Dictionary of Slang

leek n.

also leake, leek-eater
[a national emblem]

1. (mid-17C; mid-19C) the penis.

[UK]Mercurius Democritus 22 May 5: The other [girl] long’d for a Leek, and the other laying down his Lass, gave her a Leek that fill’d her Belly, and two raw Onions very large and fair.
[Ire]Spirit of Irish Wit 112: ‘Oh! by J—s, then my lady,’ answered Pat, ‘I find the Welchman has put the leek in your ladyship’.
[UK]‘Cowslip and the Gardener’s Leek’ in Flash Minstrel! in Spedding & Watt (eds) Bawdy Songbooks (2011) I 117: But he pull’d out so long a leek, / He made the pretty damsel squeak.
[Aus]Dead Bird (Sydney) 25 Oct. 1/3: Flossie Fowclothes [...] asked the Rooster which out of all vegetables he preferred. Chanticleer replied, ‘turnup and lettuce.’ Flossie blushed, and said her favorites were ‘leeks and sparrow- grass’.

2. a Welsh person.

[UK]New Canting Dict.
[UK]Defoe Street Robberies Considered 33: Leake, Welshman.
[UK]Morn. Advertiser (London) 19 Nov. 3/7: If it were not for the well-known ‘leek-eating’ braggadocio of the writer, one would recoil.
[US]E. Forbes in Wilson & Geikie Memoir (1861) 442: An account of our work here may tell upon the Welsh meeting, and stir up the leek-eaters.

In phrases

swallow the leek (v.)

to undergo an unpleasant experience that cannot be avoided.

[UK]Sportsman (London) 23 Dec. 2/1: Notes on News [...] Experience has taught us that there are various wavs which, in ‘swallowing the leek,’ the disagreeable flavour of the pungent vegetable may be subdued, if not altogether overcome.