The term "gay" has a fascinating linguistic and cultural history:
Etymological origin
The word "gay" comes from Old French "gai", itself derived from Occitan gai and probably of Germanic origin.
Originally, it meant joyful, carefree, lively. It is found in expressions such as gai savoir (lou gai sabé), which referred to the pleasure of learning among the troubadours.
Evolution of the meaning
17th–19th centuries: in English, "gay" begins to describe a dissolute life or one linked to prostitution. People spoke of a gay life for a life of pleasures that did not conform to moral norms.
1920s–1930s: in the United States, "gay" is used in homosexual circles to express a form of freedom, exuberance or carefreeness.
1940s–1970s: the word becomes a common noun designating homosexual men, notably after the Stonewall riots of 1969, which mark a turning point in the fight for + rights.
Cultural anecdote: the film Bringing Up Baby (1938) is considered the first to use the word "gay" in reference to homosexuality, in a humorous scene with Cary Grant.