Localization
SDK supports Russian and English localizations by default.
To add support for a new language or change current translation:
- Add your translation file to bundle (application/framework)
- Specify it in
ChatLocalizationConfigduring SDK initialization
Configuration example:
// SDK initialization
let chatCenterSdk = ChatCenterUISDK(providerUid: "providerUid",
chatConfig: chatConfig,
loggerConfig: ChatLoggerConfig(logLevel: .all))
// Localization setup
chatCenterSdk.localizationConfig = ChatLocalizationConfig(bundle: Bundle.main, tableName: "CustomLocalizable")
Main Localization Keys
| Category | Key | Default Value (EN) |
|---|---|---|
| Buttons | action.title_ok | OK |
action.title_yes | Yes | |
action.title_no | No | |
action.title_cancel | Cancel | |
action.title_repeat | Retry | |
| Chat | chat.title.opened | Contact Center |
chat.title.connecting | Connecting... | |
chat.title.typing | operator is typing | |
| Input | input.placeholder | Message |
| Messages | message.deleted_text | Message deleted |
message.status.not_delivered | Not delivered | |
| Search | search.placeholder_title | Search |
search.not_found_title | No results found | |
| Errors | errors.connection_timeout | Connection timeout |
errors.load_config | Failed to load chat settings |
For complete list of localization keys and their usage, refer to the Russian version of this documentation or demo application.
Custom Localization File Example
Create CustomLocalizable.strings file in your project:
// Buttons
"action.title_ok" = "OK";
"action.title_yes" = "Yes";
"action.title_no" = "No";
"action.title_cancel" = "Cancel";
// Chat
"chat.title.opened" = "Support Chat";
"chat.title.connecting" = "Connecting...";
// Input
"input.placeholder" = "Type your message...";
// Messages
"message.deleted_text" = "This message was deleted";
Then configure SDK to use it:
chatCenterSdk.localizationConfig = ChatLocalizationConfig(
bundle: Bundle.main,
tableName: "CustomLocalizable"
)