Skip to content

Commit

Permalink
Merge pull request #1667 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Oct 26, 2023
2 parents 131c7d1 + e735fa8 commit 7a298df
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
Empty file removed apps/web/i18next.d.ts
Empty file.
15 changes: 0 additions & 15 deletions apps/web/next-i18next.config.js

This file was deleted.

22 changes: 19 additions & 3 deletions apps/web/ni18n.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
const supportedLngs = ['en', 'fr', 'ar', 'bg', 'zh', 'nl', 'de', 'he', 'it', 'pl', 'pt', 'ru', 'es'];
export const ni18nConfig = {

i18n.use(initReactI18next).init({
lng: 'en',
fallbackLng: 'en',
ns: ['common'],
defaultNS: 'common',
supportedLngs,
ns: ['common']
};
interpolation: {
escapeValue: false
}
});

supportedLngs.forEach((lang) => {
i18n.addResourceBundle(lang, 'common', require(`/public/locales/${lang}/common.json`));
});

export default i18n;
17 changes: 9 additions & 8 deletions apps/web/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import { ThemeProvider } from 'next-themes';
import type { AppProps } from 'next/app';
import Head from 'next/head';
import Script from 'next/script';
import { appWithI18Next } from 'ni18n';
import { I18nextProvider } from 'react-i18next';
import { SkeletonTheme } from 'react-loading-skeleton';
import { RecoilRoot } from 'recoil';
import { JitsuAnalytics } from '../lib/components/services/jitsu-analytics';
import { ni18nConfig } from '../ni18n.config';

import i18n from '../ni18n.config';
const MyApp = ({ Component, pageProps }: AppProps) => {
const isJitsuEnvsPresent = jitsuConfiguration.host && jitsuConfiguration.writeKey;
return (
Expand Down Expand Up @@ -47,10 +46,12 @@ const MyApp = ({ Component, pageProps }: AppProps) => {
<RecoilRoot>
<ThemeProvider attribute="class">
<SkeletonTheme baseColor="#F0F0F0" enableAnimation={false}>
<AppState />
<JitsuAnalytics user={pageProps?.user} />
<ChatwootWidget />
<Component {...pageProps} />
<I18nextProvider i18n={i18n}>
<AppState />
<JitsuAnalytics user={pageProps?.user} />
<ChatwootWidget />
<Component {...pageProps} />
</I18nextProvider>
</SkeletonTheme>
</ThemeProvider>
</RecoilRoot>
Expand All @@ -59,4 +60,4 @@ const MyApp = ({ Component, pageProps }: AppProps) => {
</>
);
};
export default appWithI18Next(MyApp, ni18nConfig);
export default MyApp;
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5095,7 +5095,7 @@
lodash.merge "^4.6.2"
postcss-selector-parser "6.0.10"

"@tanstack/[email protected]":
"@tanstack/react-table@^8.10.7":
version "8.10.7"
resolved "https://registry.yarnpkg.com/@tanstack/react-table/-/react-table-8.10.7.tgz#733f4bee8cf5aa19582f944dd0fd3224b21e8c94"
integrity sha512-bXhjA7xsTcsW8JPTTYlUg/FuBpn8MNjiEPhkNhIGCUR6iRQM2+WEco4OBpvDeVcR9SE+bmWLzdfiY7bCbCSVuA==
Expand Down

0 comments on commit 7a298df

Please sign in to comment.