Skip to content

Commit 0cf8cf1

Browse files
Merge pull request #124 from SingularityNET-Archive:development
feat: Fixed auto translate problem
2 parents 189401d + 13326de commit 0cf8cf1

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

next.config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {}
3-
4-
module.exports = nextConfig
2+
const nextConfig = {
3+
i18n: {
4+
locales: ['en'], // Add other languages if needed
5+
defaultLocale: 'en',
6+
localeDetection: false, // Disable automatic locale detection
7+
},
8+
}
9+
10+
module.exports = nextConfig

pages/_document.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
2+
3+
class MyDocument extends Document {
4+
static async getInitialProps(ctx: DocumentContext) {
5+
const initialProps = await Document.getInitialProps(ctx)
6+
return { ...initialProps }
7+
}
8+
9+
render() {
10+
return (
11+
<Html>
12+
<Head>
13+
<meta name="google" content="notranslate" />
14+
</Head>
15+
<body>
16+
<Main />
17+
<NextScript />
18+
</body>
19+
</Html>
20+
)
21+
}
22+
}
23+
24+
export default MyDocument

0 commit comments

Comments
 (0)