silverwolf-x's picture
download
raw
509 Bytes
export type MessageConfig = Record<string, string>;
export default async function loadI18nMessages(
locale: string,
defaultLocale = "en",
) {
// If the default locale is being used we can skip it
if (locale === defaultLocale) {
return {};
}
try {
return import(`../compiled-lang/${locale}.json`).then(
(module) => module.default,
);
} catch (error) {
throw new Error(
'Could not load compiled language files. Please run "npm run i18n:compile" first"',
);
}
}

Xet Storage Details

Size:
509 Bytes
·
Xet hash:
8da787286d6e3ef834635b67aed636dd43013ba5e83693744ca353359fab40d3

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.