feat: add translations for emails and type error fixes overall (#994)
* feat: add translations for forgot password email and misc * fix: type fixes * feat: translate invitation email * fix: e2e tests * fix: lint * feat: type fixes and i18n for emails * Merge main * fix: jest import on server path * Merge * fix: playwright tests * fix: lint Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
1 parent
356d470e16
commit
8d6fec79d3
35 files changed
+680
-461
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import i18next from "i18next";
|
||||
import { i18n as nexti18next } from "next-i18next";
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||
|
||||
export const getTranslation = async (locale: string, ns: string) => {
|
||||
const create = async () => {
|
||||
const { _nextI18Next } = await serverSideTranslations(locale, [ns]);
|
||||
const _i18n = i18next.createInstance();
|
||||
_i18n.init({
|
||||
lng: locale,
|
||||
resources: _nextI18Next.initialI18nStore,
|
||||
fallbackLng: _nextI18Next.userConfig?.i18n.defaultLocale,
|
||||
});
|
||||
return _i18n;
|
||||
};
|
||||
const _i18n = nexti18next != null ? nexti18next : await create();
|
||||
return _i18n.getFixedT(locale, ns);
|
||||
};
|
||||
Reference in new issue
Block a user