The SDK contains language folders for each language supported. For a list of supported languages, see LiveEngage System Requirements and Language Support. Each folder contains LPLocalizable.strings file, where all strings are located for a specific language.
The example below contains four language folders:
- en.lproj: strings in English. Used in case the host app/device language is not supported by us.
- fr.lproj: strings in French.
- pt.lproj: strings in Portuguese.
- pt-PT.lproj: strings in Portuguese (Portugal).
The SDK allows you to override the string localization of any supported language in LiveEngage.
To apply a custom localization files with your own strings, create LPLocalizable.strings files for relevant languages inside your app, which will include the keys you would like to override.
Example: Overriding the SDK string of 'send’ in English:
- Create in your app a new localization Base file called LPLocalizable.strings which will include your supported language: 'New file…’ -> 'Strings file’ -> 'Create’
- Add new key: "send" = "
Mark this LPLocalizable.strings file as localized: Tap on LPLocalizable.strings file -> Open the file inspector -> Go to 'Localization’ section -> Tap 'Localize…’
Adding a new supported language
- Open project settings
- Info tab
- Under Localizations, press '+’ sign
- Choose the new language you would like to support.
Attaching a Strings file to existing supported languages:
- Choose the desired strings file
- Open the file inspector
- Under localizations, choose the relevant languages.
Your 'send’ string implementation will override the localization in English in the SDK
In order to print all localized keys with a default English value in the SDK, call the following:
In order to get or print all localized supported languages in the SDK, call the following:
In order to get all supported languages by key-value (key is locale key and value is language description), call the following:
Note: The SDK uses native iOS control for the Copy/Paste menu. The language of the menu control is defined by the current device language if the host app is localized for this language. If the host app does not have this language, the last menu control language will be used.