fix(i18n): load locales from file system, instead of http-backend

This commit is contained in:
Amruth Pillai
2022-03-05 10:08:28 +01:00
parent 7c73685759
commit a4983ac6bc
74 changed files with 105 additions and 142 deletions

View File

@ -1,18 +1,15 @@
import HttpBackend from 'i18next-http-backend';
import { UserConfig } from 'next-i18next';
import { join } from 'path';
const i18nConfig = {
const i18nConfig: UserConfig = {
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
debug: false,
nsSeparator: '.',
localePath: join(__dirname, '../../../public/locales'),
ns: ['common', 'modals', 'landing', 'dashboard', 'builder'],
serializeConfig: false,
use: [HttpBackend],
backend: {
loadPath: `${process.env.NEXT_PUBLIC_APP_URL}/locales/{{lng}}/{{ns}}.json`,
},
};
export default i18nConfig;