Skip to main content

Localize

With language localization, CometChat UI Kit adapts to the language of a specific country or region. CometChatLocalize allows you to detect the language of your users based on their browser settings and set the language accordingly.

Supported languages

Currently, we support the following 12 languages for localization:

  • English (en, en-US, en-GB)
  • Chinese (zh, zh-TW)
  • Spanish (es)
  • Hindi (hi)
  • Russian (ru)
  • Portuguese (pt)
  • Malay (ms)
  • French (fr)
  • German (de)
  • Swedish (sv)
  • Lithuanian (lt)
  • Hungarian (hu)

Methods

NameDescription
initThis method is used for setting the language in for UI Kit. This will take the constant value from the Language and will set the value accordingly.
localizeThis method is used translate the provided text to the active language.
getLocale()This method is used to get the current language. By default, it will return current language from device/browser.
setLocale()Used for setting the current language in for UI Kit. It takes the enum value from Language enum and sets the value accordingly.

Init

The default language of the CometChat UI Kit is set to the language in your browser settings. If browser language does not belong to the list of supported languages, it fallbacks to English language. You could also override the default language.

This method allows you to override default or pre-defined text strings with custom translations or alternative values. This also supports adding new languages to the list of supported languages.

//initialise localisation
CometChatLocalize.init();

//override default language
CometChatLocalize.init("de");

//override default strings
CometChatLocalize.init("de", {
de: {
USERS: "Nutzer",
},
});

//adding new languages
CometChatLocalize.init("ro", {
ro: {
CHATS: "Chat-uri",
},
});

localize

This method accepts the string to localize and return the localized string.

CometChatUIKit.localize("CHATS");
NameDescription
ccUserBlockedThis event is triggered when the user successfully blocks another user.
ccUserUnblockedThis event is triggered when the user successfully unblocks another user.

String resources

Conversations

KeyValue
CHATSChats
WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATIONWould you like to delete this conversation? This conversation will be deleted from all of your devices.
NO_CHATS_SELECTEDNo Chats Selected
DELETE_CONVERSATIONDelete Conversation?
ADD_TO_CHATAdd to Chat
NO_CHATS_FOUNDNo chats found
CLICK_TO_START_CONVERSATIONClick to start conversation
IN_A_THREADIn a thread
MESSAGE_IMAGE📷 Image
MESSAGE_FILE📁 File
MESSAGE_AUDIO🎵 Audio
MESSAGE_VIDEO📹 Video
CUSTOM_MESSAGEYou have a message
CUSTOM_MESSAGE_POLL📊 Poll
CUSTOM_MESSAGE_STICKER💟 Sticker
CUSTOM_MESSAGE_DOCUMENT📃 Document
CUSTOM_MESSAGE_WHITEBOARD📝 Whiteboard

Users

KeyValue
USERSUsers
NO_USERS_FOUNDNo users found
BLOCK_USERBlock User
UNBLOCK_USERUnblock User

Groups

KeyValue
GROUPSGroups
NO_GROUPS_FOUNDNo groups found
NEW__GROUPNew Group
CREATE_GROUPCreate Group
ENTER_GROUP_NAMEEnter group name
PASSWORDPassword
ENTER_GROUP_PASSWORDEnter group password
SELECT_GROUP_TYPESelect group type
CONTINUEContinue
GROUP_PASSWORD_BLANKGroup password cannot be blank
INVALID_PASSWORDPlease enter a valid password for the group and try again
WRONG_PASSWORDPlease enter the correct password and try again
GROUP_NAME_BLANKGroup name cannot be blank
INVALID_GROUP_NAMEPlease enter a valid name for the group and try again
GROUP_TYPE_BLANKGroup type cannot be blank
INVALID_GROUP_TYPEPlease enter a valid type for the group and try again
ADMINISTRATORAdministrator
ADMINAdmin
MODERATORModerator
PARTICIPANTParticipant
PUBLICPublic
PRIVATEPrivate
PASSWORD_PROTECTEDPassword Protected
PRIVATE_GROUPPrivate Group
PROTECTED_GROUPProtected Group
ADD_MEMBERSAdd Members
ADDINGAdding...
DELETE_AND_EXITDelete and Exit
LEAVE_CONFIRMAre you sure you want to leave the group?
LEAVE_GROUPLeave Group
LEAVELeave
BANNED_MEMBERSBanned Members
UNBANUnban
NO_BANNED_MEMBERS_FOUNDNo banned members found
VIEW_MEMBERSView Members
GROUP_MEMBERSGroup Members
KICKKick
BANBan
OWNEROwner
CHANGE_SCOPEChange Scope
TRANSFER_OWNERSHIPTransfer Ownership
TRANSFERTransfer
TRANSFER_CONFIRMYou are the group owner, please transfer ownership to a member before leaving the group
JOINJoin
REMOVERemove
BLOCKBlock
CHANGE_ROLEChange Role
MEMBERSMembers
MEMBERMember

Messages

KeyValue
TODAYToday
YESTERDAYYesterday
SUNDAYSunday
MONDAYMonday
TUESDAYTuesday
WEDNESDAYWednesday
THURSDAYThursday
FRIDAYFriday
SATURDAYSaturday
TYPINGtyping...
IS_TYPINGis typing...
SEND_MESSAGESend Message
COPY_MESSAGECopy
DELETE_MESSAGEDelete message
EDIT_MESSAGEEdit message
REPLYreply
REPLIESreplies
LAUNCHLaunch
SHARED_COLLABORATIVE_DOCUMENThas shared a collaborative document
SHARED_COLLABORATIVE_WHITEBOARDhas shared a collaborative whiteboard
CREATED_WHITEBOARDYou’ve created a new collaborative whiteboard
CREATED_DOCUMENTYou’ve created a new collaborative document
MESSAGE_IS_DELETEDMessage is Deleted
CREATE_POLLCreate Poll
QUESTIONQuestion
VOTESvotes
VOTEvote
NO_VOTENo vote
ENTER_YOUR_QUESTIONEnter your question
COLLABORATIVE_DOCUMENTCollaborative Document
COLLABORATE_USING_DOCUMENTCollaborate using a document
OPEN_WHITEBOARDOpen Whiteboard
COLLABORATE_USING_WHITEBOARDCollaborate using a whiteboard
ADD_REACTIONAdd reaction
REACTEDreacted
TRANSLATE_MESSAGETranslate message
TRANSLATED_MESSAGETranslated message
ATTACHAttach
ATTACH_FILEAttach file
ATTACH_AUDIOAttach audio
ATTACH_VIDEOAttach video
ATTACH_IMAGEAttach image
EMOJIEmoji
ENTER_YOUR_MESSAGE_HEREEnter your message here
NO_MESSAGES_FOUNDNo messages found
THREADThread
REPLY_TO_THREADReply to thread
REPLY_IN_THREADReply in thread
VIEWView
VIEW_DETAILView Detail
LIVE_REACTIONLive Reaction
JUMPJump
NEW_MESSAGESnew messages
NEW_MESSAGEnew message

Calls

KeyValue
CALLSCalls
CALL_DETAILSCall Details
MISSED_VOICE_CALLMissed voice call
MISSED_VIDEO_CALLMissed video call
INCOMING_AUDIO_CALLIncoming audio call
DECLINEDecline
ACCEPTAccept
CALL_INITIATEDCall initiated
OUTGOING_AUDIO_CALLOutgoing audio call
OUTGOING_VIDEO_CALLOutgoing video call
CALL_REJECTEDCall rejected
REJECTED_CALLrejected call
CALL_ACCEPTEDCall accepted
OUTGOING_CALLOutgoing call
INCOMING_CALLIncoming call
MISSED_CALLMissed call
MISSED_AUDIO_CALLMissed audio call
JOINEDjoined
CALL_ENDEDCall ended
CALL_CANCELLEDCall cancelled
CALLINGCalling...
SELECT_VIDEO_SOURCESelect video source
SELECT_INPUT_AUDIO_SOURCESelect input audio source
SELECT_OUTPUT_AUDIO_SOURCESelect output audio source
INITIATED_GROUP_CALLhas initiated a group call
YOU_INITIATED_GROUP_CALLYou’ve initiated a group call
RESIZEResize

Misc

KeyValue
LOADINGLoading...
SEARCHSearch
ERRORError