Overview
CometChat UI Kit provides language localization to adapt to the language of a specific country or region. The CometChatLocalize class allows you to detect the language of your users based on their browser or device settings, and set the language accordingly. CometChatLocalize is a class that includes methods related to locale. Developers can use these methods to change the language of the UI Kit library. Presently, the UI Kit supports 19 languages for localization, which are:- 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
Update MaterialApp Localizations Delegates
You can also translate specific strings. For example:
Customizing UI Kit Translations for a Specific Language
To override a specific language’s default translations in the CometChat UI Kit, you can create a custom localization class and delegate. The example below demonstrates how to override the English (en) language by customizing labels such as “chats” and “calls”. This allows you to tailor the UI text to better fit your application’s tone or branding requirements.
Adding New Language Support in CometChat UI Kit
This implementation demonstrates how to extend the CometChat Flutter UI Kit with custom localization support for the Telugu (te) language. By creating a custom translation class and registering it through a LocalizationsDelegate, developers can override or define translation strings such as “Chats” and “Calls” in Telugu. This approach enables personalized and region-specific user experiences beyond the default set of supported languages in the UI Kit.