Configuring custom field to store end user's language
The purpose of this article is to explain how to access and set the locale of the end user in a custom field in the Zendesk plugin. This article applies to both the Parallel and Inline apps.
Where does the customer locale value in the app come from?
In Parallel versions before 3.2.20 and Inline versions before 1.1.5, the app takes the customer locale (that is, the language of the end user) from the value stored in the Zendesk customer profile language.
Newer versions of the applications prioritize the value in a custom text field, if it is configured and populated. If admins do not to configure this custom field, the app falls back to the language defined in the customer profile.
Why use a custom field?
The name of the custom field is LIO Detected Locale Code. This field allows you to store and use locale codes that may not be supported by Zendesk. This allows you to preserve the correct locale code in the custom field, and prevent the ticket from loading an outdated locale with each translation request.
If the LIO Detected Locale Code custom field is configured, the app populates the field each time a locale is detected from Language IO.
To change the end user’s language in the app, you can also manually edit the value in this field, save the ticket, then reload the app.
Does the app have access to the end user’s browser locale?
No, the app does not have access to the browser locale of the end user. It relies on locale values that are detected with the LIO detectLocale endpoint.
The End User default locale
User profiles created by agents default to the language of the agent’s organization, however email tickets and tickets created by web widgets use some auto detection (although it often defaults to en-us).
Both the Parallel and Inline Language IO plugins are configured on launch to load the Zendesk profile language as the customer locale in the app UI. This is why new user tickets load in English before the first translation has been made. Once a language is detected aftert he first translation request, this language is saved in the Zendesk customer profile.