Did you know that leraar is a Dutch word? A new API, LangID can help you with those pesky language identification problems. Feed it a string of text and the API returns the name of the language, its ISO code and even an image of the flag for a country that speaks the language (the latter could be a hot-button political issue–watch out). You can choose your output as either XML or browser-friendly JSON (more technical details at our LangID API profile).
LangID is a very straightforward API, and lthough it stops short of providing actual translation, it could conceivably be used along with translation services like the Google AJAX Language API or the Microsoft Translator API.
In terms of accuracy, the service becomes more reliable the longer the block of text you provide (you must include at least five characters). For example, it may not always help you match foods to countries: “No burrito” returned as English, while LangID claimed “lasagna” is Icelandic.
The API is just one of the many ways that LangID provides language identification. You can also use its website, Twitter, or a few other methods. Knowing which language to use is a first step to translating, and perhaps LangID will add in the second step – the actual translation – with its next iteration.