Dynamic Language

Provide a seamless user experience by dynamically adapting the language of your Userback widget to match your application's configuration or user settings.

📘

Before you start

The Userback widget must be installed on your website. See the Widget Installation Guide if you haven't done this yet.


🚧

Custom text & translation

Custom text set in the widget settings won’t auto-translate. If you need advanced customization or multi-language support, reach out to us for tailored solutions.


Basic usage

Dynamically Configure Language Settings

You can set the widget's language dynamically using widget_settings.

Userback.widget_settings = {
    language: "en" // Replace "en" with any supported language code
    // ... additional settings can be placed here
};

Note: Use valid language codes (see the full list below).


Common use cases

Default Language Setting

  • English:

    Userback.widget_settings = { language: 'en' };
  • French:

    Userback.widget_settings = { language: 'fr' };
  • Simplified Chinese:

    Userback.widget_settings = { language: 'zh-CN' };

Advanced use case

Dynamic language switching

In multi-language applications, switch the widget language dynamically based on user preferences.

function changeLanguage(lang) {
  Userback.destroy(true); // Destroy the existing widget
  Userback.init(%%widget_access_token%%, {
    widget_settings: {
      language: lang
    }
  }); // Initialize the widget with the new language setting
}

// Example Usage
changeLanguage('es'); // Switch to Spanish

Supported language codes

LanguageCodeLanguageCode
EnglishenPortuguese (Brazil)pt-br
DanishdaDutchnl
GermandeNorwegianno
SpanishesRomanianro
EstonianetRussianru
FinnishfiSlovaksk
FrenchfrSwedishsv
HungarianhuSimplified Chinesezh-CN
ItalianitTraditional Chinesezh-TW
Japanesejp
Koreanko
Lithuanianlt
Polishpl

Need help? Visit the Help Center or use the chat bubble on this page to contact our support team.