Answered

Can I add a language override to Intercom's mobile SDKs?

  • 17 February 2021
  • 1 reply
  • 379 views

  • New Participant
  • 0 replies

In our application the language can be changed from "settings" and does not depend from device language. But your SDK choose language from the device settings and I have problem with that.

How can I change SDK language?

icon

Best answer by Anonymous 17 February 2021, 17:17

View original

1 reply

Hey. I've shared a couple of code snippets below that should help you. There's a few things to note:

 

  • The override only works for languages we support. A full list of languages is available here.
  • The override is a server-side feature, so when you use these snippets an API call is made. You'll want to make sure that you set this when you initialise Intercom or when your customer's setting is changed. Doing it immediately before the Messenger is opened may result in the language override not being applied.

 

Android:

Intercom.client().updateUser(new UserAttributes.Builder().withLanguageOverride("FR").build());

 

iOS:

ICMUserAttributes *userAttributes = [ICMUserAttributes new];

userAttributes.languageOverride = @"FR";

[Intercom updateUser:userAttributes];

Reply