i18next / i18next-browser-languageDetector

language detector used in browser environment for i18next
MIT License
865 stars 88 forks source link

8.0.0版本的打包产物不兼容低版本浏览器(?.操作符号) #291

Open wogaozhixu opened 2 months ago

wogaozhixu commented 2 months ago

🐛 Bug Report

A clear and concise description of what the bug is. name: "querystring", lookup(e) { let t, {lookupQuerystring: r} = e; if ("undefined" !== typeof window) { let {search: e} = window.location; !window.location.search && window.location.hash?.indexOf("?") > -1 && (e = window.location.hash.substring(window.location.hash.indexOf("?"))); const n = e.substring(1).split("&"); for (let o = 0; o < n.length; o++) { const e = n[o].indexOf("="); e > 0 && n[o].substring(0, e) === r && (t = n[o].substring(e + 1)) } } return t }

To Reproduce

A minimal reproducible example. A codesandbox example or similar or at least steps to reproduce the behavior:

// Paste your code here

Expected behavior

A clear and concise description of what you expected to happen.

// Paste the expected results here

Your Environment

jamuhl commented 2 months ago

sorry, but the bug description is completely unclear to me

adrai commented 2 months ago

v8.0.0 is only compatible with newer browsers see changelog: https://github.com/i18next/i18next-browser-languageDetector/pull/286

if you need to support older browsers without transpilation, use v7

adrai commented 2 months ago

//cc @VIKTORVAV99

VIKTORVAV99 commented 2 months ago

I'm really interested in how this is used as I would assume most people are using a build system to handle transpilation.

Could you share some insights into how you bundling your website?