diff --git a/ui/summit-2023/package-lock.json b/ui/summit-2023/package-lock.json index 1c3c350c4..81b446826 100644 --- a/ui/summit-2023/package-lock.json +++ b/ui/summit-2023/package-lock.json @@ -7,7 +7,6 @@ "": { "name": "cardanovoting", "version": "0.2.4", - "hasInstallScript": true, "dependencies": { "@cardano-foundation/cardano-connect-with-wallet": "^0.1.57", "@emotion/react": "^11.11.0", @@ -18,11 +17,13 @@ "@textea/json-viewer": "^3.0.0", "@types/uuid": "^9.0.2", "history": "^5.3.0", + "i18next": "^22.4.14", "json-canonicalize": "^1.0.6", "moment": "^2.29.4", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hot-toast": "^2.4.1", + "react-i18next": "^12.2.0", "react-redux": "^8.0.7", "react-router-dom": "^6.11.1", "react-scripts": "5.0.1", @@ -11930,6 +11931,14 @@ "node": ">= 12" } }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/html-webpack-plugin": { "version": "5.5.3", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.5.3.tgz", @@ -12079,6 +12088,28 @@ "node": ">=8.12.0" } }, + "node_modules/i18next": { + "version": "22.5.1", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.5.1.tgz", + "integrity": "sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "dependencies": { + "@babel/runtime": "^7.20.6" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -18820,6 +18851,27 @@ "react-dom": ">=16" } }, + "node_modules/react-i18next": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-12.3.1.tgz", + "integrity": "sha512-5v8E2XjZDFzK7K87eSwC7AJcAkcLt5xYZ4+yTPDAW1i7C93oOY1dnr4BaQM7un4Hm+GmghuiPvevWwlca5PwDA==", + "dependencies": { + "@babel/runtime": "^7.20.6", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 19.0.0", + "react": ">= 16.8.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -22305,6 +22357,14 @@ "range-slice-stream": "^2.0.0" } }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/ui/summit-2023/package.json b/ui/summit-2023/package.json index 58d393df9..7b2cb9c1d 100644 --- a/ui/summit-2023/package.json +++ b/ui/summit-2023/package.json @@ -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", diff --git a/ui/summit-2023/src/i18n/index.ts b/ui/summit-2023/src/i18n/index.ts new file mode 100644 index 000000000..dddd12940 --- /dev/null +++ b/ui/summit-2023/src/i18n/index.ts @@ -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 }; diff --git a/ui/summit-2023/src/i18n/locales/en/en.json b/ui/summit-2023/src/i18n/locales/en/en.json new file mode 100644 index 000000000..eeedd4007 --- /dev/null +++ b/ui/summit-2023/src/i18n/locales/en/en.json @@ -0,0 +1,3 @@ +{ + "hello": "world" +} \ No newline at end of file diff --git a/ui/summit-2023/tsconfig.json b/ui/summit-2023/tsconfig.json index 006fe5ff3..66a878b79 100644 --- a/ui/summit-2023/tsconfig.json +++ b/ui/summit-2023/tsconfig.json @@ -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" + ] }