All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.util.detectNavigatorLanguage.js.map Maven / Gradle / Ivy

{"version":3,"file":"detectNavigatorLanguage.js","sourceRoot":"","sources":["../../src/util/detectNavigatorLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AAE9C,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACpC,IAAI,KAAK,EAAE;QACV,OAAO,gBAAgB,CAAC;KACxB;IACD,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAAC;IAE7C,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC9B,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC3B,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,iBAAiB,EAAE,CAAC;IAEnF,OAAO,SAAS,IAAI,gBAAgB,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["import { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst detectNavigatorLanguage = () => {\n\tif (isSSR) {\n\t\treturn DEFAULT_LANGUAGE;\n\t}\n\tconst browserLanguages = navigator.languages;\n\n\tconst navigatorLanguage = () => {\n\t\treturn navigator.language;\n\t};\n\n\tconst rawLocale = (browserLanguages && browserLanguages[0]) || navigatorLanguage();\n\n\treturn rawLocale || DEFAULT_LANGUAGE;\n};\n\nexport default detectNavigatorLanguage;\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy