PageSourceSearch

https://chunxiang.ai/assets/i18n-Bhptq2l7.js

js chunxiang.ai collected 2026-10-05 12:21:42 UTC 750 bytes, 1 lines download raw bytes

1import{r as o,d as l,e as r,j as u}from"./index-CodWtdDH.js";const c="site-locale";function i(){if(typeof window>"u")return null;const e=window.localStorage.getItem(c);return e==="zh"||e==="en"?e:null}function d(){const[e,t]=o.useState(l);return o.useEffect(()=>{const n=i();if(n){t(n);return}t(r(window.navigator.languages))},[]),o.useEffect(()=>{document.documentElement.lang=e==="zh"?"zh-CN":"en"},[e]),{locale:e,toggleLocale:()=>{t(n=>{const s=n==="en"?"zh":"en";return window.localStorage.setItem(c,s),s})}}}function f({locale:e,onClick:t,className:a}){return u.jsx("button",{type:"button",className:a??"language-button","aria-label":e==="en"?"Switch to Chinese":"切换到英文",onClick:t,children:e==="en"?"中":"EN"})}export{f as L,d as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.