UNPKG

@astrolicious/i18n

Version:

Yet another i18n integration for Astro with server and client utilities, type safety and translations built-in.

2 lines 490 B
import{existsSync as m,readdirSync as i}from"node:fs";import{basename as c,extname as p}from"node:path";var d=(s,a,r)=>{let o=[];if(m(s)){let e=i(s).filter(t=>t.endsWith(".json"));for(let t of e)o.push({namespaceName:c(t,p(t)),fileName:t})}let n=o.map(e=>e.namespaceName);return r.info(`Detected namespaces: ${n.map(e=>`"${e}"`).join(",")}`),n.includes(a)||r.warn(`Default namespace "${a}" is not detected`),{namespaces:n}};export{d as getNamespaces}; //# sourceMappingURL=namespaces.js.map