As a non-techie, I don't understand the language example they're using. It seems to me many prediction engines are originally built to try to forecast winning lottery numbers or other such gambling events. Google expects me to believe they did this for language?
The point is that they took a large number of documents, which are clearly labelled as to language, gave it as a training set to the machine, and they now have a classifier that lets you input random text and tells you the language it was probably written in. In principle you can do this with any data set and any set of discrete outcomes. In general, though, you should expect that the resulting classifier won't give…
Incidentally, Google Translate does this and starts guessing the source language as you start typing. I found it interesting that when you type a single character, w is guessed as Polish, i is Norwegian, s is Czech, e is Portuguese...