Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 50616a8

Browse files
author
lei
committed
feat: 🎸 新增国际化
1 parent 2c7ef90 commit 50616a8

File tree

9 files changed

+14726
-52
lines changed

9 files changed

+14726
-52
lines changed

‎.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"i18n-ally.localesPaths": [
3+
"public/locales",
4+
"src/i18n"
5+
]
6+
}

‎index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import React from 'react';
1+
import React,{Suspense} from 'react';
22
import ReactDOM from 'react-dom';
3+
import './src/i18n';
34
import { Provider } from 'react-redux';
45
import { BrowserRouter as Router } from 'react-router-dom';
56
import store from './src/store';
67
import Layout from './src/Layout';
78
import ScrollToTop from './src/components/ScrollToTop';
8-
99
const App = () => (
10-
<Provider store={store}>
11-
<Router>
12-
<ScrollToTop>
13-
<Layout />
14-
</ScrollToTop>
15-
</Router>
16-
</Provider>
10+
<Suspense fallback="loading">
11+
<Provider store={store}>
12+
<Router>
13+
<ScrollToTop>
14+
<Layout />
15+
</ScrollToTop>
16+
</Router>
17+
</Provider>
18+
</Suspense>
1719
);
1820

1921
ReactDOM.render(<App />, document.getElementById('root'));

‎package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"name": "design-patterns-game",
33
"version": "1.0.0",
44
"dependencies": {
5+
"i18next": "^23.5.1",
6+
"i18next-http-backend": "^2.2.2",
57
"prop-types": "15.7.2",
68
"react": "^16.9.0",
79
"react-dom": "^16.9.0",
10+
"react-i18next": "^13.2.2",
811
"react-redux": "7.1.3",
912
"react-router-dom": "5.1.0",
1013
"react-syntax-highlighter": "^10.3.5",
@@ -57,6 +60,7 @@
5760
"babel-plugin-require-context-hook": "1.0.0",
5861
"babel-preset-env": "1.7.0",
5962
"babel-preset-react": "6.24.1",
63+
"copy-webpack-plugin": "^5.1.1",
6064
"coveralls": "3.0.8",
6165
"cypress": "3.6.1",
6266
"enzyme": "3.10.0",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /