Skip to content

Commit

Permalink
feat: i18next
Browse files Browse the repository at this point in the history
  • Loading branch information
wkylin committed Dec 14, 2023
1 parent 0c5a641 commit e1fe1cf
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
]
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"cSpell.customDictionaries": {
"custom-dictionary-workspace": {
Expand Down
40 changes: 33 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
},
"dependencies": {
"@ant-design/cssinjs": "^1.18.0",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@loadable/component": "^5.15.3",
"@react-spring/web": "^9.7.3",
"@react-three/drei": "^9.89.3",
Expand Down
11 changes: 2 additions & 9 deletions src/i18n/i18n.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import i18n from 'i18next'
// import Backend from 'i18next-http-backend'
import { initReactI18next } from 'react-i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import translationInZh from '../locales/zh/translation.json'
import translationInEn from '../locales/en/translation.json'
// import translationInZh from '../locales/zh/translation'
// import translationInEn from '../locales/en/translation'
import translationInZh from '../locales/zh/translation'
import translationInEn from '../locales/en/translation'

i18n
// .use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
// backend: {
// loadPath: `${process.env.PUBLIC_URL}/locales/{{lng}}/{{ns}}.json`,
// },
resources: {
en: {
translation: translationInEn,
Expand Down

1 comment on commit e1fe1cf

@vercel
Copy link

@vercel vercel bot commented on e1fe1cf Dec 14, 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:

pro-react-admin – ./

pro-react-admin-wkylin.vercel.app
pro-react-admin.vercel.app
pro-react-admin-git-main-wkylin.vercel.app

Please sign in to comment.