This section is dedicated to localization of the chat interface in your Flutter app. You can update the text elements, titles and other text pieces used in the chat interface according to the language you prefer.
Note: The changes need to be done on both Native Android and iOS.
Android - Chat localization setup
Follow these steps to add locale support in the SDK:
Create the 'Android resource directory' for the locale. For example, create 'values-es' for Spanish locale in your 'res' directory.
Create the string resource file for your locale and place it under the directory you created in the first step. For example, create file
strings.xmland place it under 'values-es' directory.
Download and override resource string for your locale from below links. Translate all the strings from the below files to your locale and place it in the strings.xml file.
Example: Change resource string (message) value to Spanish locale:
iOS - Chat Localization Setup
Localizing Kommunicate iOS SDK is a two-step process:
- Download the sample
Localizable.stringsfile from here.
- Then copy-paste all the text entries from above
Localizable.stringsfile in your project's
Localizable.stringsfile after modifying the values in your application's supported language.
To know more about adding language support in iOS, you can read Apple's documentation here
We also have an option to pass a custom localization file name. If you want to keep all Kommunicate SDK related keys in a separate file, then pass the name of your file like this:
// Add this in the AppDelegate's didFinishLaunchingWithOptions method Kommunicate.defaultConfiguration.localizedStringFileName = "SampleKommunicateLocalizable"
RTL - Right to Left support
Few languages such as Arabic, Hebrew, and Persian are written from Right to Left. RTL support is necessary to accommodate them. Kommunicate also supports the languages written in the Right to Left direction.
To test the RTL support, change the phone language to Arabic or Hebrew and open the Kommunicate chat/sample app to see the changes.