Skip to content

Commit

Permalink
🔧 chore: Add debug option and modify appWithTranslation usage
Browse files Browse the repository at this point in the history
- Add debug option in next-i18next.config.js
- Modify _app.page.tsx to use appWithTranslation HOC

The changes were made to improve the debugging experience and enhance the internationalization functionality of the application.
  • Loading branch information
canisminor1990 committed Jul 16, 2023
1 parent 47c3f0e commit 853f18a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const i18n = require('./.i18nrc');

/** @type {import('next-i18next').UserConfig} */
module.exports = {
debug: process.env.NODE_ENV === 'development',
i18n: {
defaultLocale: i18n.entryLocale,
locales: [i18n.entryLocale, ...i18n.outputLocales],
Expand Down
12 changes: 7 additions & 5 deletions src/pages/_app.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import type { AppProps } from 'next/app';

import Layout from '@/layout';

function MyApp({ Component, pageProps }: AppProps) {
const App = appWithTranslation(({ Component, pageProps }: AppProps) => (
<Component {...pageProps} />
));

export default (props: AppProps) => {
return (
<Layout>
<Component {...pageProps} />
<App {...props} />
<Analytics />
</Layout>
);
}

export default appWithTranslation(MyApp);
};

2 comments on commit 853f18a

@vercel
Copy link

@vercel vercel bot commented on 853f18a Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lobe-chat-for-public – ./

lobe-chat-for-public-git-master-lobehub.vercel.app
lobe-chat-for-public-lobehub.vercel.app
lobe-chat.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 853f18a Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.