cal.pub0.org/packages/lib/hooks/useLocale.ts

11 lines
225 B
TypeScript
Raw Normal View History

import { useTranslation } from "next-i18next";
export const useLocale = (namespace: Parameters<typeof useTranslation>[0] = "common") => {
const { i18n, t } = useTranslation(namespace);
return {
i18n,
t,
};
};