Skip to main content
All CollectionsUser guides and instructions
Showing widgets in the site visitor’s language
Showing widgets in the site visitor’s language

Learn how to create multilingual versions of a widget and show the widget in the language selected by the site visitor

V
Written by Vitalii Shumilov
Updated over a year ago

In Claspo, you can create language versions of widgets and show the widget on your site in the language selected by the site visitor.

To identify the language, the Claspo script parses the html element’s lang attribute value.

Example:

<!DOCTYPE html>
<html lang="en-US">

If this value is not detected, the browser’s preferred language is used.

Example:

> navigator.languages
< (2)['en-US', 'uk']

NOTE

You have to install the Claspo script to show widgets in the visitor’s language.

To install the script, select the Script item in the left-hand side menu and follow the instructions, or read this article to learn how to install the script using WordPress or Google Tag Manager.

Adding language versions of the widget

To add language versions of the widget:

  1. In the widget editor, expand the language dropdown menu (the globe icon) on the top panel and select + Specify the default language.

  2. Scroll down the list and select the language, or start entering the language name in the search box and select the language.

  3. To add another language, expand the language dropdown menu on the top panel and select + Add a language.

  4. Scroll down the list and select the language, or start entering the language name in the search box and select the language.

  5. Click Yes in the dialog window.

  6. Select the text containing elements and translate their text into the selected language. When you are done, click Save.

  7. Repeat steps 3 to 6 to add more language versions of the widget.

Did this answer your question?