Skip to main content
CometChat UIKit supports 19 languages out of the box with runtime language switching. You can override translations globally without modifying source files.

Setting the Language


Global Translation Overrides

Override specific translation keys for any language:
Existing keys are replaced; new keys are added. All other translations remain unchanged.

Using the Translate Pipe

Resolution Priority

When resolving a translation key:
  1. Global translation for current language
  2. Fallback language translation (default: en-US)
  3. Returns the key itself if nothing found

Adding a New Language


Programmatic Translation

In TypeScript code (outside templates):

Initialization Options


Date & Time Localization

CalendarObject

Use CalendarObject to customize how dates and times are displayed throughout the UIKit. Supports relative time formatting for minutes and hours.
Changing this format globally updates the date and time representation wherever it is used. If a component-specific CalendarObject is provided, it takes higher precedence over the global settings.

Global Configuration

Apply a custom date format globally via CometChatLocalize.init():

Component-Specific Configuration

Pass a CalendarObject directly to a component to override the global format for that component only:

formatDate

Format a Unix timestamp using a CalendarObject directly: Returns a formatted date string.