Languages
Setting up multilingual support for the cookie banner
How the banner picks a language
The banner is shown in one of the languages you have enabled. Free and Solo use one language; Pro and Agency can enable more. With several languages enabled, the banner picks in this order:
langattribute on the<html>element- The visitor's browser language
- Your default language
Supported languages
Consentio supports all 24 official EU languages including:
| Language | Code | Language | Code |
|---|---|---|---|
| Czech | cs |
Slovak | sk |
| English | en |
German | de |
| Polish | pl |
Hungarian | hu |
| French | fr |
Spanish | es |
| Italian | it |
Portuguese | pt |
| Dutch | nl |
Swedish | sv |
| Greek | el |
Romanian | ro |
| Bulgarian | bg |
Croatian | hr |
Enabling more languages
A new website starts in the language of your dashboard. On Free and Solo you pick the banner's single language in the place described below; on Pro and Agency you switch on each language yourself and choose which one is the default:
- Open Banner Design and choose your website
- Go to Texts
- Pick the language in the + Add language menu
- Click Save changes
Forcing a specific language
If you want a page to show the banner in a specific language, set the lang
attribute on the <html> element. It has to be one of the languages you have enabled:
<!DOCTYPE html>
<html lang="cs">
<head>
<!-- The banner uses Czech, provided Czech is enabled -->
<script src="https://consentio.cz/widget/YOUR_SCRIPT_KEY/consentio.min.js" async></script>
</head>
...
Multilingual website
For websites with multiple language versions, we recommend:
Option 1: The lang attribute in HTML
Set the correct lang attribute on each language version:
<!-- Czech version -->
<html lang="cs">
<!-- English version -->
<html lang="en">
<!-- German version -->
<html lang="de">
Option 2: Dynamic setting
The banner reads the lang attribute once, when the widget starts. In an SPA or a dynamic website, set it before that, in an inline script in the <head>. A change made later applies from the next full page load:
// Get the current language from your application
const currentLang = getCurrentLanguage() // e.g. 'en'
// Set the language on the HTML element
document.documentElement.lang = currentLang
// The widget reads html[lang] when it starts; a later change applies after a full page load
Custom translations
You can edit the texts of every enabled language. The Free plan can edit the title and description; all texts open from the Solo plan:
- In the dashboard, go to Banner Design → Texts
- Click the tab of the language
- Edit the individual text strings
- Click Save changes
Available text for editing
| Field | Default text (EN) |
|---|---|
| Title | We use cookies |
| Description | We use cookies to enhance your browsing experience... |
| Accept button | Accept All |
| Reject button | Reject All |
| Settings button | Settings |
| Modal title | Cookie Preferences |
| Save button | Save Preferences |
| Categories → Necessary | Necessary |
| Categories → Analytics | Analytics |
| Categories → Marketing | Marketing |
| Categories → Functionality | Functionality |
Adding a new language
If you need a language that is not in the supported list:
- Contact our support at info@consentio.cz
- Alternatively, rewrite the texts of a language you have enabled into the language you need
Language detection
Among the languages you have enabled, the widget picks from these sources (in order of priority):
-
HTML lang attribute - Highest priority. The widget uses the language
defined in
<html lang="cs">. -
Browser language - If the
langattribute is not set or names a language you have not enabled, the widget uses the visitor's browser language. - Default language - If neither is among your enabled languages, the default language is used.
lang attribute
on the <html> element according to the current language version of the page.