Overview
The SeggWat feedback widget supports multiple languages to provide a localized experience for your users. Language detection happens automatically based on the user’s browser settings, or you can specify a language explicitly.Supported Languages
🇬🇧 English
Code:
en (default)🇩🇪 German
Code:
de🇸🇪 Swedish
Code:
svUsage
Automatic Detection
By default, the widget automatically detects the user’s browser language:If the user’s browser is set to German (
de-DE), the widget will display in German. If the browser language is not supported, English is used as a fallback.Manual Language Selection
Explicitly set the language using thedata-language attribute:
Translated Strings
All UI elements are translated, including:| Element | English | German | Swedish |
|---|---|---|---|
| Button | Feedback | Feedback | Feedback |
| Modal Title | Send Feedback | Feedback senden | Skicka feedback |
| Modal Subtitle | We’d love to hear your thoughts! | Wir freuen uns auf Ihr Feedback! | Vi skulle gärna höra dina tankar! |
| Label | Your Feedback | Ihr Feedback | Din feedback |
| Placeholder | Tell us what you think… | Sagen Sie uns, was Sie denken… | Berätta vad du tycker… |
| Cancel Button | Cancel | Abbrechen | Avbryt |
| Submit Button | Send Feedback | Feedback senden | Skicka feedback |
| Sending… | Sending… | Wird gesendet… | Skickar… |
| Success | Thank you for your feedback! | Vielen Dank für Ihr Feedback! | Tack för din feedback! |
| Error | Sorry, there was an error… | Entschuldigung, beim Senden… | Tyvärr uppstod ett fel… |
How It Works
Language Detection Flow
Translation Loading
- Detection: The widget determines the language from
data-languageornavigator.language - Validation: Checks if the language is in the supported list (
en,de,sv) - Fetching: Loads the translation file from
/static/i18n/{lang}.json - Fallback: If loading fails, uses hardcoded English translations
- Rendering: Displays the widget with translated text
Dynamic Language Updates
You can change the widget language after initialization without reloading the page:Example: Language Switcher Integration
The language change is asynchronous as it fetches new translation files. All UI text updates automatically, including the button text, modal title, labels, and messages.