Skip to content

Commit dd6b9c4

Browse files
committed
feat: 国际化插件 & 基础配置
1 parent 16997a0 commit dd6b9c4

File tree

18 files changed

+368
-43
lines changed

18 files changed

+368
-43
lines changed

components/layout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ const Layout: FC<ILayoutProps & { children: JSX.Element }> = ({
2424
);
2525
};
2626

27-
export default Layout;
27+
export default Layout;

components/navbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {FC, useContext} from "react";
1+
import {FC, useContext, useEffect} from "react";
22
import styles from "./styles.module.scss";
33
import Image from "next/image";
44
import logoIcon from "@/public/logo-icon.svg";

next-i18next.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
i18n: {
3+
defaultLocale: 'zh-CN',
4+
locales: ['en', 'zh-CN'],
5+
},
6+
localePath: 'public/locales',
7+
defaultNS: [],
8+
debug: false,
9+
ns: ['header', 'main', 'footer']
10+
}

next.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
const path = require("path");
22

33
const semi = require("@douyinfe/semi-next").default({});
4-
4+
const { i18n } = require('./next-i18next.config')
55
module.exports = semi({
66
reactStrictMode: true,
77
swcMinify: true,
8+
i18n,
89
webpack: (config) => {
910
config.resolve.alias = {
1011
...config.resolve.alias,

0 commit comments

Comments
 (0)