PageSourceSearch

https://blog.abwab.ai/assets/useTranslation-xRzBcOIb.js

js abwab.ai collected 2026-09-24 12:28:09 UTC 4,006 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="708e87e6-a97e-5722-ae92-a4131e716254")}catch(e){}}();
3import{s as e}from"./jsx-runtime-D4ePz0Hl.js";import{t}from"./react-BXH-GOAS.js";import{a as n,i as r,n as i,t as a}from"./context-BmvuYzDi.js";var o=e(t());function s(){if(console&&console.warn){var e=[...arguments];h(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}var c={};function l(){var e=[...arguments];h(e[0])&&c[e[0]]||(h(e[0])&&(c[e[0]]=new Date),s(...e))}var u=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},d=(e,t,n)=>{e.loadNamespaces(t,u(e,n))},f=(e,t,n,r)=>{h(n)&&(n=[n]),n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,u(e,r))},p=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(r.toLowerCase()===`cimode`)return!0;let o=(e,n)=>{let r=t.services.backendConnector.state[`${e}|${n}`];return r===-1||r===2};return n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(r,e)&&(!i||o(a,e)))},m=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(l(`i18n.languages were undefined or empty`,t.languages),!0):t.options.ignoreJSONStructure===void 0?p(e,t,n):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}})},h=e=>typeof e==`string`,g=e=>typeof e==`object`&&!!e,_=(e,t)=>{let n=(0,o.useRef)();return(0,o.useEffect)(()=>{n.current=t?n.current:e},[e,t]),n.current},v=(e,t,n,r)=>e.getFixedT(t,n,r),y=(e,t,n,r)=>(0,o.useCallback)(v(e,t,n,r),[e,t,n,r]),b=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{i18n:s}=t,{i18n:c,defaultNS:u}=(0,o.useContext)(a)||{},p=s||c||r();if(p&&!p.reportNamespaces&&(p.reportNamespaces=new i),!p){l(`You will need to pass in an i18next instance by using initReactI18next`);let e=(e,t)=>h(t)?t:g(t)&&h(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}p.options.react&&p.options.react.wait!==void 0&&l(`It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);let b={...n(),...p.options.react,...t},{useSuspense:x,keyPrefix:S}=b,C=e||u||p.options&&p.options.defaultNS;C=h(C)?[C]:C||[`translation`],p.reportNamespaces.addUsedNamespaces&&p.reportNamespaces.addUsedNamespaces(C);let w=(p.isInitialized||p.initializedStoreOnce)&&C.every(e=>m(e,p,b)),T=y(p,t.lng||null,b.nsMode===`fallback`?C:C[0],S),E=()=>T,D=()=>v(p,t.lng||null,b.nsMode===`fallback`?C:C[0],S),[O,k]=(0,o.useState)(E),A=C.join();t.lng&&(A=`${t.lng}${A}`);let j=_(A),M=(0,o.useRef)(!0);(0,o.useEffect)(()=>{let{bindI18n:e,bindI18nStore:n}=b;M.current=!0,!w&&!x&&(t.lng?f(p,t.lng,C,()=>{M.current&&k(D)}):d(p,C,()=>{M.current&&k(D)})),w&&j&&j!==A&&M.current&&k(D);let r=()=>{M.current&&k(D)};return e&&p&&p.on(e,r),n&&p&&p.store.on(n,r),()=>{M.current=!1,e&&p&&e.split(` `).forEach(e=>p.off(e,r)),n&&p&&n.split(` `).forEach(e=>p.store.off(e,r))}},[p,A]),(0,o.useEffect)(()=>{M.current&&w&&k(E)},[p,S,w]);let N=[O,p,w];if(N.t=O,N.i18n=p,N.ready=w,w||!w&&!x)return N;throw new Promise(e=>{t.lng?f(p,t.lng,C,()=>e()):d(p,C,()=>e())})};export{l as a,s as i,g as n,h as r,b as t};
4//# sourceMappingURL=useTranslation-xRzBcOIb.js.map
5//# debugId=708e87e6-a97e-5722-ae92-a4131e716254

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.