From 3b730ff366cd5a867ff4a7c5b6344f41039d3602 Mon Sep 17 00:00:00 2001 From: akathedeveloper <114748865+akathedeveloper@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:37:06 +0530 Subject: [PATCH] i18next Upgraded --- package-lock.json | 19 ++++++++++--------- package.json | 2 +- src/utils/errorHandler.tsx | 5 ++++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21f2a480fc..ae6719d5ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "graphql-tag": "^2.12.6", "graphql-ws": "^5.16.0", "history": "^5.3.0", - "i18next": "^21.8.14", + "i18next": "^23.11.5", "i18next-browser-languagedetector": "^8.0.0", "i18next-http-backend": "^2.5.2", "inquirer": "^8.0.0", @@ -13152,9 +13152,9 @@ } }, "node_modules/i18next": { - "version": "21.10.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.10.0.tgz", - "integrity": "sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==", + "version": "23.13.0", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.13.0.tgz", + "integrity": "sha512-B+g0/KTKmN3+NeMKPljQxdrih6Q6lyDF5O2e/Ofd0JQsTLojJD/BSTTN04iw6OVc0yBiHeypu5hoBNV6ag44Zw==", "funding": [ { "type": "individual", @@ -13169,8 +13169,9 @@ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" } ], + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.17.2" + "@babel/runtime": "^7.23.2" } }, "node_modules/i18next-browser-languagedetector": { @@ -34456,11 +34457,11 @@ "dev": true }, "i18next": { - "version": "21.10.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.10.0.tgz", - "integrity": "sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==", + "version": "23.13.0", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.13.0.tgz", + "integrity": "sha512-B+g0/KTKmN3+NeMKPljQxdrih6Q6lyDF5O2e/Ofd0JQsTLojJD/BSTTN04iw6OVc0yBiHeypu5hoBNV6ag44Zw==", "requires": { - "@babel/runtime": "^7.17.2" + "@babel/runtime": "^7.23.2" } }, "i18next-browser-languagedetector": { diff --git a/package.json b/package.json index 40fbc877dd..502648a9fe 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "graphql-tag": "^2.12.6", "graphql-ws": "^5.16.0", "history": "^5.3.0", - "i18next": "^21.8.14", + "i18next": "^23.11.5", "i18next-browser-languagedetector": "^8.0.0", "i18next-http-backend": "^2.5.2", "inquirer": "^8.0.0", diff --git a/src/utils/errorHandler.tsx b/src/utils/errorHandler.tsx index bb5d7ab05e..cdc6ebd5c6 100644 --- a/src/utils/errorHandler.tsx +++ b/src/utils/errorHandler.tsx @@ -7,7 +7,10 @@ import i18n from './i18n'; If the error is due to the Talawa API being unavailable, it displays a custom message. */ export const errorHandler = (a: unknown, error: unknown): void => { - const tErrors: TFunction = i18n.getFixedT(null, 'errors'); + const tErrors = i18n.getFixedT( + null, + 'errors', + ) as unknown as TFunction; if (error instanceof Error) { switch (error.message) { case 'Failed to fetch':