Bold360 and BoldChat Developer Center

Change Language

On the pre-chat form a language selector is presented many times. If the user changes the language, it is required to change the localized field and option titles of the form to the selected language.

This is done by the changeLanguage selector of the chat session. It asks for the new brandings dictionary that will be stored in the chat session.

To get the new brandings:

id<BCCancelable> cancelable = [chatSession changeLanguage:<language id> delegate:<delegate>];

The language id is the same format as specified in creating a chat session. The result:

- (void)bcChatSession:(id<BCChatSession>)chatSession didChangeToLanguage:(NSString *)language withBranding:(NSDictionary *)branding {
    // Changing the language was successful. 
    // The new language string and branding dictionary is returned, an also stored in the chatSession.
}
- (void)bcChatSession:(id<BCChatSession>)chatSession didFailToChangeLanguageWithError:(NSError *)error {
    //Changing language failed.
    //Check error.code to values from BCErrorCodes.h to find out the cause of the error.
}