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 startThe Userback widget must be installed on your website. See the Widget Installation Guide if you haven't done this yet.
Custom text & translationCustom 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 SpanishSupported language codes
| Language | Code | Language | Code |
|---|---|---|---|
| English | en | Portuguese (Brazil) | pt-br |
| Danish | da | Dutch | nl |
| German | de | Norwegian | no |
| Spanish | es | Romanian | ro |
| Estonian | et | Russian | ru |
| Finnish | fi | Slovak | sk |
| French | fr | Swedish | sv |
| Hungarian | hu | Simplified Chinese | zh-CN |
| Italian | it | Traditional Chinese | zh-TW |
| Japanese | jp | ||
| Korean | ko | ||
| Lithuanian | lt | ||
| Polish | pl |
Need help? Visit the Help Center or use the chat bubble on this page to contact our support team.