Skip to main content
Version: 5.9.0

Localization

The SDK includes built-in translations for Russian and English.

To add a new language or change the current translation:

  1. Create a .strings file with the translation in your application's bundle (a template to copy is at the end of the page).
  2. Set up ChatLocalizationConfig on the SDK instance.

Constructor

init(bundle: Bundle, tableName: String, locale: Locale = .current)

FieldTypeRequiredDescription
bundleBundleYesThe bundle that contains the translation file (usually Bundle.main)
tableNameStringYesThe .strings file name without extension (for example, "MyLocalizable" for the file MyLocalizable.strings)
localeLocaleNo (default .current)Sent to the server and determines the language of server responses; the SDK also uses it in date and number formatters
ChatLocalizationConfig fields are accessible only via init

All three fields are passed to the initializer; they cannot be read or modified from outside. To change the localization, create a new instance and assign it to chatCenterSDK.localizationConfig.

The table must exist in the bundle

If bundle does not contain a .strings file with the specified tableName, an assertionFailure will fire in a debug build. In a release build, the SDK will silently fall back to the built-in translation for the device's system locale. Before publishing, make sure the file is added to the target as a resource.

Setup example:

// Configure localization (after SDK initialization)
chatCenterSDK.localizationConfig = ChatLocalizationConfig(
bundle: Bundle.main,
tableName: "MyLocalizable",
locale: Locale(identifier: "ru")
)
localizationConfig is stored globally (process-wide)

The config is not bound to a ChatCenterUISDK instance. If multiple instances live in the process (for example, for switching between test and production environments), assigning localizationConfig to any of them overwrites the value for all. Use one config for all instances and do not change it on the fly.

Key not found in your .strings

The SDK falls back to the value from the built-in ChatLocalizable.strings for the device's system locale. Override only the keys you want to change — the rest are picked up automatically.

Dynamic language switching at runtime

If the application supports multiple languages and allows switching between them without a restart, load translations for the SDK from the appropriate .lproj catalog — for example, ru.lproj/MyLocalizable.strings or en.lproj/MyLocalizable.strings. Create a Bundle at the .lproj path and assign a new ChatLocalizationConfig:

func switchLanguage(to language: String) {
guard
let path = Bundle.main.path(forResource: language, ofType: "lproj"),
let bundle = Bundle(path: path)
else { return }

chatCenterSDK.localizationConfig = ChatLocalizationConfig(
bundle: bundle,
tableName: "MyLocalizable",
locale: Locale(identifier: language)
)
}

// In the language switch handler:
switchLanguage(to: "en")
Assign localizationConfig before authorize(user:)

locale is sent to the server on connection and determines the language of server responses — for example, automatic notification and survey texts. The server reads it once, at the moment of authorize(user:).

If you change localizationConfig after authorization, on the next getChat() the UI will pick up the strings from the new bundle, but server responses will keep arriving in the previous language. You cannot change the server-side locale within an active session of the same user — restart the application or authorize a different user.

locale must match the selected .lproj.


Localization keys (table with examples)
CategoryKeyDefault valueUsage example / NotesUsage
Buttonsaction.title_okOKUsed in confirmation dialogs (for example, "Are you sure?" → OK/Cancel)Usage
action.title_yesYesIn questions like "Continue? Yes/No"Usage
action.title_noNoIn questions like "Continue? Yes/No"Usage
action.title_cancelCancelIn modals, menus, loading, message sendingUsage
action.title_repeatRetryOn chat loading errorUsage
action.alert_sendSendIn the file send formUsage
Chatchat.available_readonly_textThis chat is available for viewing onlyShown when the user cannot writeUsage
chat.client_nameYouIn the quote headerUsage
chat.title.connectingConnecting...In the chat headerUsage
chat.title.openedContact centerIn the chat header after openingUsage
chat.title.waiting_for_specialistLooking for an operator...In the chat header after the conversation startsUsage
chat.title.workingOperatorShown in the chat header during a dialogUsage
chat.title.typingoperator is typingShown below the chat header while the operator is typingUsage
Operator rolesoperator.botBotIn the chat header, depends on the operator roleUsage
operator.external.botBotIn the chat header, depends on the operator roleUsage
operator.operatorOperatorIn the chat header, depends on the operator roleUsage
operator.supervisorOperatorIn the chat header, depends on the operator roleUsage
operator.systemOperatorIn the chat header, depends on the operator roleUsage
operator.integrationOperatorIn the chat header, depends on the operator roleUsage
Loadingloading.titleLoadingWhen loading historyUsage
Inputinput.placeholderMessageWhen the input field is emptyUsage
input.voice_recording_hintHold to start recordingHint on long press of the microphoneUsage
Empty chatempty_chat.placeholder_titleWelcome to the contact centerShown on the first chat openUsage
empty_chat.placeholder_descSend your question, the first available operator will answer it.Usage
Send errorsalert.resend_failed_message.title""May be empty, depends on the implementationUsage
alert.resend_failed_message.descThe message was not sent. Tap "resend" to sendDescription of the resend menuUsage
alert.resend_failed_message.retry_btnResendUsage
alert.resend_failed_message.delete_btnDeleteUsage
Access / Permissionsalert.access_denied_titleNo accessPermissions are not set up on the serverUsage
alert.file_sending_denied_descFile sending is disabled on the serverPermissions are not set up on the serverUsage
alert.unlock_photos_accessUnlock photo access in the app settings to continueUsage
alert.camera_not_foundNo camera found on your deviceNotification when trying to use the camera on a device without one
alert.send_selected_file_to_chatSend the selected file "%@" to chat?%@ — file nameUsage
alert.unlock_camera_accessUnlock camera access in the app settings to continueNotification when the user has denied accessUsage
alert.cant_take_photoFailed to take a photoNotification, failed to take a photo with the cameraUsage
alert.app_settingsSettingsMenu item in the notificationUsage
alert.voice_recording_deniedMicrophone access denied; to record voice messages, allow access in settingsNotification descriptionUsage
alert.text_copied_messageText copied to clipboardNotification that text was copied to the clipboardUsage
Message statusesmessage.status.not_deliveredNot deliveredError text below the messageUsage
message.status.validation_errorNot deliveredError text below the messageUsage
Messagesmessage.deleted_textMessage deletedUsage
message.send_file_limit_alert_titleFile sizeFile size limit exceededUsage
message.send_file_limit_alert_messageMaximum allowed file size for sending exceeded (%.0f MB)%.0f — the number is substituted (for example, 25 MB)Usage
message.incorrect_url_for_openingFailed to open the linkWhen tapping a link in a message that cannot be openedUsage
message.photo_titlePHOTOShown in the quote of a photo messageUsage
message.voice_titleVOICE MESSAGEShown in the quote of a voice messageUsage
message.voice_play_errorPlayback errorPlayback error shown below the messageUsage
message.unsupported_file_formatUnsupported formatFormat error, shown below the messageUsage
Quote menumenu.response_titleReplyQuote menuUsage
menu.copy_titleCopyQuote menuUsage
Searchsearch.placeholder_titleSearchUsage
search.not_found_titleNo results foundNo results foundUsage
search.image_attachment_titleimageFile name in search resultsUsage
search.audio_attachment_titleaudio fileFile name in search resultsUsage
Surveyssurvey.message_vote_from_titleofScore shown after survey completion in history. For example "2 of 5"-
survey.message_thanks.titleThank you for your ratingMessage after survey completionUsage
survey.request_close_thread_messageThe specialist has answered all your questions, continue the consultation?Usage
SDK errorserrors.init_failed_titleA problem occurred while initializing the chat:Chat loading errorUsage
errors.connection_timeoutConnection to server timed outNetwork errorUsage
errors.load_configFailed to load chat settingsChat loading errorUsage
errors.voice_messageFailed to complete file uploadError shown below the messageUsage
errors.code_from_400_to_500_titleSorry for the inconvenience, the chat is currently unavailable. Please try again later.Connection error when entering the chat. TitleUsage
errors.code_from_400_to_500_desc""Connection error when entering the chatUsage
errors.disallowed_file_loadingFile upload failed.\nFailed to verify the fileError shown below the messageUsage
errors.timeout_during_load_fileFailed to complete file upload, timeout expired.\nTry uploading the file laterError shown below the messageUsage
errors.unexpected_error_during_load_fileFailed to complete file upload.\nTry sending the file laterError shown below the messageUsage
errors.during_load_fileAn error occurred while uploading or verifying the fileError shown below the messageUsage
Attachments menuattachments.menu.my_albumsMy albumsMenu itemUsage
attachments.menu.take_photoTake a photoMenu itemUsage
alert.picker_files_btnFilesMenu itemUsage

Full .strings file for copying
// Buttons
"action.title_ok" = "OK";
"action.title_yes" = "Yes";
"action.title_no" = "No";
"action.title_cancel" = "Cancel";
"action.title_repeat" = "Retry";
"action.alert_send" = "Send";

"chat.available_readonly_text" = "This chat is available for viewing only";
"chat.client_name" = "You"; // Address to the client (quotes, own messages in search, etc.)

"chat.title.connecting" = "Connecting..."; // Connecting to the server
"chat.title.opened" = "Contact center"; // Chat opened
"chat.title.waiting_for_specialist" = "Looking for an operator..."; // Waiting for an operator to connect
"chat.title.working" = "Operator"; // Operator joined the dialog
"chat.title.typing" = "operator is typing";

// Specialist title (Role)
"operator.bot" = "Bot";
"operator.external.bot" = "Bot";
"operator.operator" = "Operator";
"operator.supervisor" = "Operator";
"operator.system" = "Operator";
"operator.integration" = "Operator";

"loading.title" = "Loading"; // Chat loading indicator

"input.placeholder" = "Message"; // Placeholder in the input panel
"input.voice_recording_hint" = "Hold to start recording"; // Voice recording hint

"empty_chat.placeholder_title" = "Welcome to the contact center"; // Placeholder in an empty chat
"empty_chat.placeholder_desc" = "Send your question, the first available operator will answer it."; // Description of the empty chat placeholder

"alert.resend_failed_message.title" = "";
"alert.resend_failed_message.desc" = "The message was not sent. Tap \"resend\" to send";
"alert.resend_failed_message.retry_btn" = "Resend";
"alert.resend_failed_message.delete_btn" = "Delete";
"alert.access_denied_title" = "No access";
"alert.file_sending_denied_desc" = "File sending is disabled on the server";
"alert.unlock_photos_access" = "Unlock photo access in the app settings to continue";
"alert.send_selected_file_to_chat" = "Send the selected file \"%@\" to chat?";
"alert.picker_files_btn" = "Files";
"alert.camera_not_found" = "No camera found on your device";
"alert.unlock_camera_access" = "Unlock camera access in the app settings to continue";
"alert.cant_take_photo" = "Failed to take a photo";
"alert.app_settings" = "Settings";
"alert.voice_recording_denied" = "Microphone access denied; to record voice messages, allow access in settings";
"alert.text_copied_message" = "Text copied to clipboard";

// Message statuses
"message.status.not_delivered" = "Not delivered";
"message.status.validation_error" = "Not delivered";

// Messages
"message.deleted_text" = "Message deleted";
"message.send_file_limit_alert_title" = "File size";
"message.send_file_limit_alert_message" = "Maximum allowed file size for sending exceeded (%.0f MB)";
"message.incorrect_url_for_opening" = "Failed to open the link";
"message.photo_title" = "PHOTO";
"message.voice_title" = "VOICE MESSAGE";
"message.voice_play_error" = "Playback error";
"message.unsupported_file_format" = "Unsupported format";

// Quote menu
"menu.response_title" = "Reply";
"menu.copy_title" = "Copy";

// Search
"search.placeholder_title" = "Search"; // Placeholder in the search bar
"search.not_found_title" = "No results found";
"search.image_attachment_title" = "image";
"search.audio_attachment_title" = "audio file";

// Surveys
"survey.message_vote_from_title" = "of";
"survey.message_thanks.title" = "Thank you for your rating";
"survey.request_close_thread_message" = "The specialist has answered all your questions, continue the consultation?";

// SDK errors
"errors.init_failed_title" = "A problem occurred while initializing the chat:";
"errors.connection_timeout" = "Connection to server timed out";
"errors.load_config" = "Failed to load chat settings";
"errors.voice_message" = "Failed to complete file upload"; // Error while uploading a voice message
"errors.code_from_400_to_500_title" = "Sorry for the inconvenience, the chat is currently unavailable. Please try again later.";
"errors.code_from_400_to_500_desc" = "";
"errors.disallowed_file_loading" = "File upload failed.\nFailed to verify the file";
"errors.timeout_during_load_file" = "Failed to complete file upload, timeout expired.\nTry uploading the file later";
"errors.unexpected_error_during_load_file" = "Failed to complete file upload.\nTry sending the file later";
"errors.during_load_file" = "An error occurred while uploading or verifying the file";

// Attachments menu
"attachments.menu.my_albums" = "My albums";
"attachments.menu.take_photo" = "Take a photo";