import c from"i18next";import{DEFAULT_LOCALE_PLACEHOLDER as f}from"../../../constants/common.js";import{defaultTranslationImports as u}from"../../../constants/l10n/default-translations.js";async function p(a,s){const n=a?.defaultLocale||f,i=a?.translations??{},e=a?.locales?[...new Set(a.locales.flatMap(t=>[t.code,t.code.split("-")[0]]))]:[n],l={};for(const t of e){const o=await u[t]?.()||{};l[t]={translation:{...o,...i[t]?.translation}}}return{load:"currentOnly",lng:s,nonExplicitSupportedLngs:!0,fallbackLng:t=>{if(!t)return[n];const o=t.split("-")[0];if(t===n)return o!==t?[o,n]:[n];const r=[t];return o!==t&&r.push(o),r.push(n),r},interpolation:{escapeValue:!1},debug:!1,resources:{...l}}}async function d(a,s){const n=await p(a,s);await c.init(n)}export{d as initL10n};
