MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getLang

Method getLang

src/openlayers/mapping/WebMap.js:5514–5522  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getLang * @description 检测当前cookie中的语言或者浏览器所用语言 * @returns {string} 语言名称,如zh-CN

()

Source from the content-addressed store, hash-verified

5512 * @returns {string} 语言名称,如zh-CN
5513 */
5514 getLang() {
5515 if (this.getCookie('language')) {
5516 const cookieLang = this.getCookie('language');
5517 return this.formatCookieLang(cookieLang);
5518 } else {
5519 const browerLang = navigator.language || navigator.browserLanguage;
5520 return browerLang;
5521 }
5522 }
5523 /**
5524 * @private
5525 * @function WebMap.prototype.getCookie

Callers 2

getInternetMapInfoMethod · 0.95
WebMap2Spec.jsFile · 0.80

Calls 2

getCookieMethod · 0.95
formatCookieLangMethod · 0.95

Tested by

no test coverage detected