Light (< 6k), fast and reliable language detector in JS. It does work even with relatively short texts.
Just download the
languageDetector.min.js file and include it in your project.
bower install language-detector
You just have to call it :
detectLanguage(myTextToAnalyse) and the returned value is the two characters language code.
- English (en)
- French (fr)
- Spanish (es)
- Portuguese (pt)