Localization
Overview
This section is dedicated to localization of the chat interface in your cordova/ionic/phonegap app. You can update the text elements, titles and other text pieces used in the chat interface according to the language you prefer.
Platform setup
Before you can add localization to you app, you need to have the android platorm added, so that the native functionalities can be accessed. Skip this section if you have already done the setup to target the android platform for you app.
Follow this ionic doc to get started with Android on your Ionic platform.
Now, add the android
platform, by running the following command inside you project folder:
Cordova
If you are using native cordova, use this command:
cordova platform add android --save
Ionic
If you are using ionic in your app, use this command:
ionic cordova prepare android
An android project folder will be created: platforms/android
Chat localization setup
Follow these steps to add locale support in the SDK:
Navigate to the res folder inside the android project directory (path: platforms/android/app/src/main/res).
Create the 'Android resource directory' inside the res folder, for the locale you wish to add support for. For example, create 'values-es' for the Spanish locale in your 'res' directory.
Create an empty string resource file (strings.xml) for your locale and place it under the locale directory you created in the first step. For example, for the spanish locale, create a file bye the name of
strings.xml
and 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 you just created.
Example: Change resource string (message) value to Spanish locale:
<string name="message">Mensaje</string>
Note: We have most of the strings converted to Spanish locale. You can Download the files from here. For your convenience, do cross check if all the strings have been translated and are not left out. Also, please cross check if the translation is accurate.