diff --git a/package.json b/package.json index 6960620..e87468d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cometchat/chat-uikit-react-native", - "version": "4.3.1", + "version": "4.3.2", "description": "CometChat React Native UI Kit is a collection of custom UI Components designed to build text , chat and calling features in your application. The UI Kit is developed to keep developers in mind and aims to reduce development efforts significantly", "main": "src/index", "module": "src/index", diff --git a/src/shared/CometChatContext.tsx b/src/shared/CometChatContext.tsx index be9553b..e096045 100644 --- a/src/shared/CometChatContext.tsx +++ b/src/shared/CometChatContext.tsx @@ -1,4 +1,4 @@ -import React, { createContext, useState } from 'react'; +import React, { createContext, useEffect, useState } from 'react'; import { CometChatContextType } from './base/Types'; import { CometChatTheme } from './resources/CometChatTheme'; import { CometChatLocalize } from './resources/CometChatLocalize'; @@ -31,6 +31,10 @@ export const CometChatContextProvider = (props) => { setTheme(theme); } + useEffect(() => { + CometChatLocalize.init({}) + }, []) + return ( {children} diff --git a/src/shared/resources/CometChatLocalize/CometChatLocalize.ts b/src/shared/resources/CometChatLocalize/CometChatLocalize.ts index 19feae3..92a5663 100644 --- a/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +++ b/src/shared/resources/CometChatLocalize/CometChatLocalize.ts @@ -51,7 +51,7 @@ class CometChatLocalize { * Needs to be called at the start of the application in order to set the language * @param {Object} - language & resources */ - static init = ({ language, resources }) => { + static init = ({ language, resources } : { language?: string, resources?: Record }) => { if (language) { this.locale = language; } else { diff --git a/src/shared/views/CometChatDate/CometChatDate.tsx b/src/shared/views/CometChatDate/CometChatDate.tsx index 82248b0..55c53ff 100644 --- a/src/shared/views/CometChatDate/CometChatDate.tsx +++ b/src/shared/views/CometChatDate/CometChatDate.tsx @@ -28,7 +28,7 @@ const monthNames = [ const weekNames = [ 'Sunday', 'Monday', - 'Tuseday', + 'Tuesday', 'Wednesday', 'Thursday', 'Friday',