export namespace DOMUtils { returns export function getBrowserLanguages ( ) { if ( navigator . languages !== undefined && navigator . languages . length > 0 ) { const languageList = [ ] ; for ( const lang of navigator . languages ) { languageList . push ( getIsoLanguageCode ( lang ) ) ; } return languageList ; } if ( navigator . language !== undefined ) { return [ getIsoLanguageCode ( navigator . language ) ] ; } return undefined ; } /**
     * Gets ISO-639-1 language code from browser's code (ex. en for en-US)
     */ function getIsoLanguageCode ( language ) { return language . substring ( 0 , 2 ) ; } }