Overview
CometChat V6 UI Kit provides language localization to adapt to the language of a specific country or region. TheCometChatLocalize class allows you to detect the language of your users based on their device settings and set the language accordingly.
The UI Kit supports 19 languages:
- Arabic (ar), German (de), English (en, en-GB), Spanish (es), French (fr), Hindi (hi), Hungarian (hu), Japanese (ja), Korean (ko), Lithuanian (lt), Malay (ms), Dutch (nl), Portuguese (pt), Russian (ru), Swedish (sv), Turkish (tr), Chinese (zh, zh-TW)
Usage
Integration
Add the following dependency inpubspec.yaml:
- Dart
Update MaterialApp Localizations Delegates:
- Dart
You can also translate specific strings:
- Dart
Customizing UI Kit Translations for a Specific Language
Override a specific language’s default translations by creating a custom localization class:- Dart
CustomEN.delegate to your localizationsDelegates list before cc.Translations.delegate.
Adding New Language Support
Extend the UI Kit with a new language by creating a custom translation class:- Dart
DateTimeFormatter
By providing a customDateTimeFormatterCallback, you can globally configure how time and date values are displayed across all UI components. For details, refer to the CometChatUIKit class.