Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 8x 8x 1x | /** * Return the language code of the device in lowercase * * @ignore * @param {window.navigator} navigator * @return {string|undefined} */ function getDeviceLanguage( navigator ) { const lang = navigator.languages ? navigator.languages[ 0 ] : navigator.language || navigator.userLanguage || navigator.browserLanguage || navigator.systemLanguage; return lang ? lang.toLowerCase() : undefined; } module.exports = getDeviceLanguage; |