🌐 Dynamic Language

Localize the Widget with Language Adaptation

Provide a seamless user experience by dynamically adapting the language of your Userback widget according to your apps configuration or settings.

🔐 Company Plan or higher required - Uses JavaScript SDK, more details here.

Prerequisites

  • Userback Widget installed
  • Company Plan or higher

🚧

Custom Text & Translation

Custom text in widget settings won't auto-translate. If you need more advanced customization or translation, reach out! We're here to craft the perfect solution for you.

Basic Usage

widget_settings: object

Configure the language setting of your widget dynamically.

Userback.widget_settings = {
    language: "en"  // string
    // ... additional settings can be placed here
};

Note: Values must be strings corresponding to supported language codes.


Basic Use Cases

  • English Language: Userback.widget_settings = { language: 'en' };
  • French Language: Userback.widget_settings = { language: 'fr' };
  • Simplified Chinese: Userback.widget_settings = { language: 'zh-CN' };

Advanced Use Cases

Dynamic Language Switching

In a multi-language application, dynamically switch the widget's language based on user selection or preference.

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

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

Language Code Options:

  • English: en
  • Danish: da
  • German: de
  • Spanish: es
  • Estonian: et
  • Finnish: fi
  • French: fr
  • Hungarian: hu
  • Italian: it
  • Japanese: jp
  • Korean: ko
  • Lithuanian: lt
  • Polish: pl
  • Portuguese: pt
  • Portuguese (Brazil): pt-br
  • Dutch: nl
  • Norwegian: no
  • Romanian: ro
  • Russian: ru
  • Slovak: sk
  • Swedish: sv
  • Simplified Chinese: zh-CN
  • Traditional Chinese: zh-TW

Support & Further Reading

For more information, consult the JavaScript SDK Documentation.

Encounter issues? Please send a message to our support team.