Skip to content

Commit

Permalink
fix: ts config and add i18n for json content
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed Aug 18, 2023
1 parent 92a4908 commit 8ec56c6
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 24 deletions.
62 changes: 61 additions & 1 deletion ui/summit-2023/package-lock.json

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

4 changes: 3 additions & 1 deletion ui/summit-2023/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"swiper": "^9.3.1",
"typescript": "^4.9.5",
"uuid": "^9.0.0",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"i18next": "^22.4.14",
"react-i18next": "^12.2.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Expand Down
19 changes: 19 additions & 0 deletions ui/summit-2023/src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from './locales/en/en.json';

i18n
.use(initReactI18next)
.init({
resources: {
en: {
translation: en,
},
},
fallbackLng: "en",
interpolation: {
escapeValue: false,
},
});

export { i18n };
3 changes: 3 additions & 0 deletions ui/summit-2023/src/i18n/locales/en/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"hello": "world"
}
45 changes: 23 additions & 22 deletions ui/summit-2023/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"compilerOptions": {
"outDir": "./public/",
"rootDir": "./",
"baseUrl": "src",
"resolveJsonModule": true,
"noEmitOnError": false,
"composite": true,
"module": "es2020",
"target": "es2016",
"jsx": "react",
"allowJs": false,
"moduleResolution": "node",
"target": "es2020",
"lib": [
"dom",
"dom.iterable",
"es2020"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"declaration": true,
"declarationMap": true,
"noImplicitAny": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"include": [
"src"
]
}

0 comments on commit 8ec56c6

Please sign in to comment.