v1.16.0 — The site widget speaks your visitors' language

1.16.0New featureDenis Povarov

The site widget now takes its language from the page it is on, and everything in it follows: its buttons, your help articles and the assistant's answers.

The widget's chat in Spanish: a question about invoices, the assistant's searches, and its answer in Spanish with an English help article as the source

New

  • The widget follows the page's language. It reads <html lang>, then the visitor's browser languages when the page declares none, then your project's default language. When a single-page app changes <html lang>, the widget changes with it, and the conversation stays.

  • Its own text in five languages. Tabs, buttons, the question box, error messages, the lines that show what the assistant is doing, dates and counts come in English, Russian, Spanish, French or Portuguese. labels replaces any of them, or brings another language.

  • KookeeChat.setLocale() switches the language while the widget runs, and setLocale() with nothing goes back to following the page. data-locale and locale take auto as well as a language.

  • A Language select on the Installation tab. It writes data-locale into the snippet when you pick a fixed language, and shows the preview in it.

The Language select on the Installation tab, open: Auto (page or browser), English, Русский, Español, Français and Português

Improved

  • Answers in the visitor's language. The assistant replies in the language of the visitor's latest message, and uses the widget's language only when that is unclear.

  • Regional language tags read the language you have. pt-BR gets your pt content and en-US your en content, across the whole API. A tag in any case works, and so do nb and nn for Norwegian.

Fixed

  • Help kept its collections in other languages. Asking for a language with no translated categories, or for a regional tag such as en-US, returned no collections at all. Categories now fall back to your default language, one per category.

  • One version of each article. An article with a translation no longer shows twice in Help lists and search results.

  • Translated articles stay in their collection, and a collection's article count matches its list.

Getting it

The script tag at https://kookee.dev/chat/latest.js picks all of it up with no change to your site. From npm, update to @kookee/react 1.12.0 and @kookee/sdk 1.12.0.

One change in behavior: a site that sets no language now gets the one its page declares. To keep the widget in English whatever the page says, set data-locale="en", or locale="en" in React. See Show the widget in your visitors' language in the help center.

Learn more