Like all Slavic languages, Slovenian traces its roots to the same proto-Slavic group of languages that produced Old Church Slavonic. The earliest known examples of a distinct, written Slovenian dialect are from the Freising manuscripts, known as the Brižinski spomeniki in Slovenian; the consensus estimate of their age is between 972 and 1093 (most likely in the later years of the range). These religious writings are the earliest known occurrence of any Slavic language being written using the Latin script (Carolingian minuscule). Moreover, they are among the oldest surviving manuscripts in any Slavic language.
Literary Slovenian emerged in the 16th century thanks to the works of Reformation activists Primož Trubar, Adam Bohorič and Jurij Dalmatin. During the period when present-day Slovenia was part of the Austro-Hungarian Empire, German was the language of the élíte, and Slovenian was the language of the common people. During this time, German had a strong impact on Slovenian, and many Germanisms are preserved in contemporary colloquial Slovenian. For example, in addition to the native Slovenian word blazina ("pillow"), the Austrian-German word "Polster" is also used in colloquial Slovenian, wherein it is pronounced poušter, IPA [poʊʃtər]). Similarly, Slovenian has both the native term izvijač ("screwdriver") and "šrauf'ncigr", IPA [ʃraʊfəntsɪgər]) in technical colloquial jargon, from the German word for screwdriver: "Schraubenzieher." Many Slovenian scientists before the 1920s also wrote in foreign languages, mostly German, the lingua franca of science at the time.
The cultural movements of Illyrism and Pan-Slavism brought words from Serbo-Croatian into the language. For example, Josip Jurčič, who wrote the first novel in Slovenian (Deseti brat/The Tenth Brother, published 1866) used Serbo-Croat words in his writing.
During World War II, when Slovenia was divided between the Axis Powers of Fascist Italy, Nazi Germany, and Hungary, the occupying powers suppressed the Slovenian language. The Germans were particularly emphatic, issuing propaganda suggesting that German-speaking Slovenes would be treated equally with native-born Germans.
Following World War II, Slovenia became part of the Socialist Federal Republic of Yugoslavia. Slovenian was one of the official languages of the federation, although in practice, Serbo-Croatian was forcefully put forward, again introducing Serbo-Croat elements into Slovenian. Slovenian has been used as official language in all areas of public life (including the army) only from 1991 when Slovenia gained independence. National independence has revitalized the language. It became one of the official languages of the European Union upon Slovenia's admission.
Slovenians often assert that their language is endangered, despite the fact that it now has more speakers than at any point in its history. The English linguist David Crystal said, in an interview in the summer of 2003 for the newspaper Delo, the following about the language: "No, Slovenian is not condemned to death. At least not in the foreseeable future. The number of speakers, two million, is big. Welsh has merely 500,000 speakers. Statistically, spoken Slovenian with two million speakers comes into the upper 10 per cent of the world's languages. Most languages of the world have very few speakers. Two million is a nice number: magnificent, brilliant. One probably would think this number is not much. But from the point of view of the whole world, this number has its weight. On the other hand, a language is never self-sufficient. It can disappear even in just one generation ..."