2024-11-14 01:22:43 +07:00

9 lines
307 B
TypeScript

import { getLocale } from '@/utils/common';
import { createTranslator } from 'next-intl';
export async function getTranslations(namespace: string) {
const locale = getLocale();
const messages = (await import(`./${locale}/${namespace}.json`)).default;
return createTranslator({ locale, messages });
}