Skip to main content

Overview

The UI Kit ships with translations for 19 languages. All user-facing text (button labels, status messages, timestamps, error messages) is resolved through translation keys. Set the locale prop on CometChatProvider to switch languages.

Setting the Language


Supported Languages


Accessing Translations in Components

Use the useLocale hook:

Adding Custom Translations

Override or add translation keys for a language:

Fallback Language

If a key is not found in the current language, the system falls back to the fallback language (default: en-us). Configure via CometChatLocalize:

Date & Time Localization

Date formatting respects the locale. The CometChatDate component and all timestamp displays use locale-aware formatting:
  • Relative time: “2 minutes ago”, “il y a 2 minutes”
  • Day names: “Monday”, “Lundi”
  • Date formats: “12/25/2024” (en-us), “25/12/2024” (en-gb)

Static Access (Non-React Code)

For plugins and utilities that run outside React components:

Differences from v6