All Collections
Installation & Developers
Short and Simple Guides for Devs
How to Switch the Userback Widget Language with the JavaScript API
How to Switch the Userback Widget Language with the JavaScript API
Learn how to dynamically customize the Userback Widget language for different users or different pages
Daniel Rae avatar
Written by Daniel Rae
Updated over a week ago

The Userback JavaScript API allows you to set widget options, including the ability to change the language of the widget. This allows for dynamic language selection based on the user's preferred language or location, multi-language support for different pages, and personalized experience based on user preferences or account settings.

The JavaScript API is only available on certain plans. If you're unsure if you have access to this feature, check out this article or chat with Userback support team for more information.

To change the language of the widget, you will need to use the widget_settings object and specify one of the supported language codes.

Userback.widget_settings = {
language : "en"
}

Here is an example of how to change the language of the widget to French:

<script>
Userback = window.Userback || {};
Userback.access_token = '[your widget token]';

Userback.widget_settings = {
language: "fr"
};

(function(d) {
var s = d.createElement('script');s.async = true;
s.src = 'https://static.userback.io/widget/v1.js';
(d.head || d.body).appendChild(s);
})(document);
</script>

After making this change, the Userback widget should now be displayed in French.

Please be aware that this is just an example, you will need to use your own widget token and the settings that are appropriate for your implementation.

Supported Language Codes

  • en: English

  • da: Danish

  • de: German

  • es: Spanish

  • et: Estonia

  • fi: Finnish

  • fr: French

  • hu: Hungarian

  • it: Italian

  • jp: Japanese

  • ko: Korean

  • lt: Lithuanian

  • pl: Polish

  • pt: Portuguese

  • pt-br: Portuguese (Brazil)

  • nl: Dutch

  • no: Norwegian

  • ro: Romanian

  • ru: Russian

  • sk: Slovak

  • sv: Swedish

  • zh-CN: Simplified Chinese

  • zh-TW: Traditional Chinese

Did this answer your question?