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