From 13326ded710a9e3bb1660e915cdadaca29a984be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Diamond?= <32074058+Andre-Diamond@users.noreply.github.com> Date: Sat, 29 Jun 2024 07:44:12 +0200 Subject: [PATCH] feat: Fixed auto translate problem --- next.config.js | 12 +++++++++--- pages/_document.tsx | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 pages/_document.tsx diff --git a/next.config.js b/next.config.js index 767719f..4ceedf1 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,10 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} - -module.exports = nextConfig +const nextConfig = { + i18n: { + locales: ['en'], // Add other languages if needed + defaultLocale: 'en', + localeDetection: false, // Disable automatic locale detection + }, + } + + module.exports = nextConfig \ No newline at end of file diff --git a/pages/_document.tsx b/pages/_document.tsx new file mode 100644 index 0000000..1fdfd4e --- /dev/null +++ b/pages/_document.tsx @@ -0,0 +1,24 @@ +import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document' + +class MyDocument extends Document { + static async getInitialProps(ctx: DocumentContext) { + const initialProps = await Document.getInitialProps(ctx) + return { ...initialProps } + } + + render() { + return ( + + + + + +
+ + + + ) + } +} + +export default MyDocument \ No newline at end of file