PageSourceSearch

https://ddtab.com/assets/useTranslation-C5ql18wM.js

js ddtab.com collected 2026-10-02 01:27:29 UTC 3,193 bytes, 1 lines download raw bytes

vendor: 3,193 bytes, line 1
1import{r as g}from"./chunk-QMGIS6GS-BF8ekFZt.js";import{I as _,R as j}from"./context-z4T48gJm.js";import{g as k,a as G}from"./I18n-GXDzbrzN.js";const $=(e,n,s,a)=>{var t,u,T,w;const i=[s,{code:n,...a||{}}];if((u=(t=e==null?void 0:e.services)==null?void 0:t.logger)!=null&&u.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);m(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(w=(T=e==null?void 0:e.services)==null?void 0:T.logger)!=null&&w.warn?e.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},O={},E=(e,n,s,a)=>{m(s)&&O[s]||(m(s)&&(O[s]=new Date),$(e,n,s,a))},P=(e,n)=>()=>{if(e.isInitialized)n();else{const s=()=>{setTimeout(()=>{e.off("initialized",s)},0),n()};e.on("initialized",s)}},S=(e,n,s)=>{e.loadNamespaces(n,P(e,s))},A=(e,n,s,a)=>{if(m(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(n)>-1)return S(e,s,a);s.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(n,P(e,a))},U=(e,n,s={})=>!n.languages||!n.languages.length?(E(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(e,{lng:s.lng,precheck:(a,i)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!i(a.isLanguageChangingTo,e))return!1}}),m=e=>typeof e=="string",J=e=>typeof e=="object"&&e!==null,W=(e,n)=>{const s=g.useRef();return g.useEffect(()=>{s.current=e},[e,n]),s.current},F=(e,n,s,a)=>e.getFixedT(n,s,a),X=(e,n,s,a)=>g.useCallback(F(e,n,s,a),[e,n,s,a]),D=(e,n={})=>{var R,v,z,L;const{i18n:s}=n,{i18n:a,defaultNS:i}=g.useContext(_)||{},t=s||a||k();if(t&&!t.reportNamespaces&&(t.reportNamespaces=new j),!t){E(t,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=(f,l)=>m(l)?l:J(l)&&m(l.defaultValue)?l.defaultValue:Array.isArray(f)?f[f.length-1]:f,c=[o,{},!1];return c.t=o,c.i18n={},c.ready=!1,c}(R=t.options.react)!=null&&R.wait&&E(t,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const u={...G(),...t.options.react,...n},{useSuspense:T,keyPrefix:w}=u;let r=i||((v=t.options)==null?void 0:v.defaultNS);r=m(r)?[r]:r||["translation"],(L=(z=t.reportNamespaces).addUsedNamespaces)==null||L.call(z,r);const d=(t.isInitialized||t.initializedStoreOnce)&&r.every(o=>U(o,t,u)),M=X(t,n.lng||null,u.nsMode==="fallback"?r:r[0],w),C=()=>M,x=()=>F(t,n.lng||null,u.nsMode==="fallback"?r:r[0],w),[b,p]=g.useState(C);let y=r.join();n.lng&&(y=`${n.lng}${y}`);const I=W(y),N=g.useRef(!0);g.useEffect(()=>{const{bindI18n:o,bindI18nStore:c}=u;N.current=!0,!d&&!T&&(n.lng?A(t,n.lng,r,()=>{N.current&&p(x)}):S(t,r,()=>{N.current&&p(x)})),d&&I&&I!==y&&N.current&&p(x);const f=()=>{N.current&&p(x)};return o&&(t==null||t.on(o,f)),c&&(t==null||t.store.on(c,f)),()=>{N.current=!1,t&&o&&(o==null||o.split(" ").forEach(l=>t.off(l,f))),c&&t&&c.split(" ").forEach(l=>t.store.off(l,f))}},[t,y]),g.useEffect(()=>{N.current&&d&&p(C)},[t,w,d]);const h=[b,t,d];if(h.t=b,h.i18n=t,h.ready=d,d||!d&&!T)return h;throw new Promise(o=>{n.lng?A(t,n.lng,r,()=>o()):S(t,r,()=>o())})};export{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.