History of Scottish Gaelic
All surviving dialects are Highland and/or Hebridean dialects. Dialects of Lowland Gaelic have become defunct since the demise of Galwegian Gaelic, originally spoken in Galloway, which seems to have been the last Lowland dialect and which survived into the Modern Period. By the 18th century Lowland Gaelic had been largely replaced by Lowland Scots across much of Lowland Scotland. According to a reference in "The Carrick Covenanters " by James Crichton, the last place in the Lowlands where Scottish Gaelic was still spoken was the village of Barr in Carrick: only a few miles inland to the east of Girvan, but at one time very isolated. Crichton gives neither date nor details.
Literature in early modern Scotland
By the early modern era Gaelic had been in geographical decline for three centuries and had begun to be a second class language, confined to the Highlands and Islands. The tradition of classic Gaelic poetry survived longer in Scotland than in Ireland, with the last fully competent member of the MacMhuirich dynasty, who were hereditary poets to the Lords of the Isles and then the Donalds of Clanranald, still working in the early eighteenth century. Nevertheless, interest in the sponsorship of panegyric Gaelic poetry was declining among the clan leaders. Gaelic was gradually being overtaken by Middle Scots, which became the language of both the nobility and the majority population. Middle Scots was derived substantially from Old English, with Gaelic and French influences. It was usually called "Inglyshe" and was very close to the language spoken in northern England, but by the sixteenth century it had established orthographic and literary norms largely independent of those developing in England. From the mid sixteenth century, written Scots was increasingly influenced by the developing Standard English of Southern England due to developments in royal and political interactions with England. With the increasing influence and availability of books printed in England, most writing in Scotland came to be done in the English fashion.