Add i18n translations and update tsconfig.json
This commit is contained in:
parent
23ecbf6cba
commit
790152b8c3
3
src/views/i18n/en.json
Normal file
3
src/views/i18n/en.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Delete message": "Delete message"
|
||||
}
|
@ -1,16 +1,21 @@
|
||||
import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
|
||||
import enTranslations from "./en.json";
|
||||
import zhTranslations from "./zh.json";
|
||||
console.log("enTranslations: ", enTranslations);
|
||||
console.log("zhTranslations 233: ", zhTranslations);
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
resources: {
|
||||
en: {
|
||||
translation: {
|
||||
"Delete message": "Delete message",
|
||||
...enTranslations,
|
||||
},
|
||||
},
|
||||
zh: {
|
||||
translation: {
|
||||
"Delete message": "删除消息",
|
||||
...zhTranslations,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
3
src/views/i18n/zh.json
Normal file
3
src/views/i18n/zh.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Delete message": "11删除消息"
|
||||
}
|
@ -1,26 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "ES2020",
|
||||
"lib": [
|
||||
"ES2020",
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"outDir": "./dist",
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"jsx": "react",
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": false,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./src/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"test"
|
||||
]
|
||||
}
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "commonjs",
|
||||
"target": "ES2020",
|
||||
"lib": ["ES2020", "es6", "dom"],
|
||||
"outDir": "./dist",
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"jsx": "react",
|
||||
"noImplicitAny": false,
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["test"]
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"outDir": "out-test",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "test/**/*.ts"]
|
||||
}
|
@ -72,11 +72,6 @@ const webviewConfig = {
|
||||
],
|
||||
include: /views/,
|
||||
},
|
||||
{
|
||||
test: /\.json$/i,
|
||||
use: "json-loader",
|
||||
type: "asset/source",
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|jpeg|gif|svg)$/, // 匹配文件类型
|
||||
use: [
|
||||
|
Loading…
x
Reference in New Issue
Block a user