@pelag/nts
Version:
Creation and support of the multilingual project Next.js
13 lines (9 loc) • 410 B
Plain Text
export const langConfig = {
defaultLocale: "{{defaultLocale}}",
locales: [{{locales}}],
} as const;
export type Locale = (typeof langConfig)["locales"][number];
const dictionaries = {{dictionaries}};
export const getDictionary = async (locale: Locale) =>
dictionaries[locale]?.() ?? dictionaries.{{defaultLocale}}();
export type Dictionary = Awaited<ReturnType<typeof getDictionary>>;