next-intl
Version:
Internationalization (i18n) for Next.js
2 lines (1 loc) • 566 B
JavaScript
function n(n,e,t){const r=e.split(".");let o=n;for(let n=0;n<r.length-1;n++){const e=r[n];e in o&&"object"==typeof o[e]&&null!==o[e]||(o[e]={}),o=o[e]}o[r[r.length-1]]=t}function e(n){return n.toSorted(((n,e)=>{const t=n.references?.[0],o=e.references?.[0];return t&&o?r(t,o):0}))}function t(n,e){return n.localeCompare(e,"en")}function r(n,e){const r=t(n.path,e.path);return 0!==r?r:(n.line??0)-(e.line??0)}function o(){return process.cwd()}export{r as compareReferences,o as getDefaultProjectRoot,e as getSortedMessages,t as localeCompare,n as setNestedProperty};