Android resources include Strings, drawables, layouts, and so on. When compiled, all resources are moved to the same location. App resources receive higher priority, and, due to this, in case the SDK and the App share the same resource name, the value of the App will be used. This is under OS responsibility.
SDK language support is split into two scenarios:
- Device settings: Uses device settings language → App’s language is identical to the device language.
- Host app settings: App sets its own language regardless of device settings language → language may be different from device language.
Note: The SDK language will be the same as the app language. The SDK cannot work with a language that is different from the app language. If the SDK does not support the app language, it will use the default language instead.
The SDK contains a values folders for each supported language. For a list of supported languages, see Conversational Cloud System Requirements and Language Support. Each folder contains a strings file, where all strings are located for a specific language. Learn more about supporting different languages here.
The SDK allows you to override the string localization of any supported language in Conversational Cloud. To apply a custom localization files with your own strings, create a strings file in the app’s values folder (specific values folder for the required language). This option gives the ability to change strings, and to support languages that the SDK currently does not support.
Note: In order to avoid collisions, each SDK resource starts with a prefix of "lp". This is to avoid cases where the SDK and the host app use the same ID for a specific string, for example, dialog done button.
<string name="brand_name">This new and fancy Brand name</string>
Create new Localization File
- Using Android View, right-click res and select new → Android Resource Directory.
- Under Available qualifiers of the New Resource Directory window, select Locale and move (>>) to Chosen qualifiers.
- Under Languages, select the Language or Region and click OK.
- Using Project View, right-click the values folder you just created and then select new → Values Resource File.
- In the New Values Resources File dialog, type strings.xml and click OK.