I understand how Welsh is still common as English was only spoken by the ruling class. I also understand this is how English survived the Norman invasion, despite receiving a lot of French influence. (Correct me if I'm wrong mods)
Did the medieval Kingdom of Scotland speak English or Gaelic? During what points in history did the transition take place?
hi! you may find these earlier discussions of interest
When did the majority of Scots and Irish people stop speaking Gaelic?
How different was the culture and language of the Scottish Highlands from that of the Lowlands?
Would medieval and Early Modern Scotland have predominantly spoken Gaelic?
What are the main factors behind the decline of the Scottish Gaelic language?
Which language depended upon the region in question; and keep in mind, many Scots do not speak English outside of classrooms/work environments. I'm going to mention a bunch of languages here, so if you get lost, I made a handy reference for all the languages of the British Isles for questions just like these! Link
Southern Scotland continues to speak Scots, a separate language from English but closely related. Prior to Scots, the Southern Scotsmen spoke Scotch Gaelic and (possibly) Cymric. The evidence for Cymric that far north, however, is scant. The cultural requisite to speak English, as opposed to Scots, is very recent - about the late 19th century or early 20th century or so.
Northernmost Scotland, primarily the Northern Isles, spoke Norn till the 18th century.
The rest of Scotland spoke Gaelic which survived as a sole language till the 19th century, when England exerted its cultural throes upon the last Celtic pockets.