Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
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"]}