Skip to content

Commit

Permalink
i18next Upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
akathedeveloper committed Aug 18, 2024
1 parent 47bdf2b commit 3b730ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
19 changes: 10 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion src/utils/errorHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> = i18n.getFixedT(null, 'errors');
const tErrors = i18n.getFixedT(
null,
'errors',
) as unknown as TFunction<string>;
if (error instanceof Error) {
switch (error.message) {
case 'Failed to fetch':
Expand Down

0 comments on commit 3b730ff

Please sign in to comment.