language-guess.js 300 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import {franc} from 'franc'; import langs from 'langs'; function getLang(se) { let langCode = ""; if(se.length < 10) { langCode = franc(se, {minLength:`${se.length}`}); } else { langCode = franc(se); } return langs.where('3', langCode).local; } export {getLang};