UNPKG

next-intl-split

Version:

A loader for next-intl to split translation files properly.

3 lines (2 loc) 515 B
import o from"path";import{existsSync as r}from"fs";import{loadMessages as t}from"../load/index.mjs";import{writeMessages as e}from"../write/index.mjs";const i=i=>{if(!i.startsWith("./"))throw new Error("Please provide the RELATIVE path to the dictionaries folder. Like, ./src/i18n/dictionaries");const s=o.resolve(process.cwd(),i),d=(o=>r(o))(s);if(!d)throw new Error(`The provided path to the dictionaries does not exist! ${s}`);const n=t(s);e(s,n)};export{i as mergeMessages}; //# sourceMappingURL=index.mjs.map