getlang
v1.0.4
Published
Detect a lang from a string.
Downloads
10
Readme
Get lang
Get ISO 639-1 version of a string. Without any API. This is less accurate than Google translate, but faster! :)
Install
npm install getlang -S
Use it
const getlang = require('getlang');
const result = getlang('手を切り落としたら砂金が溢れ出るとか神話とかにありそう');
console.log(result);
// => "ja"
A browserified version is available in the dist
folder. You can use it like this :
<script src="../dist/getlang.js"></script>
<script>
console.log(getlang("Quelle est ma langue"));
// => "fr"
</script>
Other
Server version:
Side Projects: