AI Integration Quick Reference
AI Integration Quick Reference
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 thelocale prop on CometChatProvider to switch languages.
Setting the Language
Supported Languages
Accessing Translations in Components
Use theuseLocale 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. TheCometChatDate 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)