Naive Bayes classifiers are very good at language identification. You find implementations in all the major languages, or you can implement one yourself, it's not extremely hard. The wikipedia entry is interesting too: https://en.wikipedia.org/wiki/Naive_Bayes_classifier.