Languages
Setting up multilingual support for the cookie banner
Automatic language detection
Consentio automatically detects the user's language and displays the banner in the corresponding language. Detection follows this order:
langattribute on the<html>elementAccept-Languageheader from the browser- Default language set in the dashboard
Supported languages
Consentio supports over 30 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 |
Russian | ru |
| Ukrainian | uk |
Romanian | ro |
| Bulgarian | bg |
Croatian | hr |
Setting the default language
Set the default language for cases when automatic detection is not possible:
- Go to your website's dashboard
- Open Settings → Languages
- Select the default language from the dropdown menu
- Save changes
Forcing a specific language
If you always want to display the banner in a specific language, set the lang
attribute on the <html> element:
<!DOCTYPE html>
<html lang="cs">
<head>
<!-- Consentio will automatically use Czech -->
<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: Automatic detection from 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
For SPAs or dynamic websites, update the lang attribute on the <html> element:
// Get the current language from your application
const currentLang = getCurrentLanguage() // e.g. 'en'
// Set the language on the HTML element
document.documentElement.lang = currentLang
// Consentio will automatically use the language from the html[lang] attribute
Custom translations
On the Pro plan, you can edit text for individual languages:
- In the dashboard, go to Designer → Text
- Select a language from the dropdown menu
- Edit the individual text strings
- Save changes
Available text for editing
| Key | Default text (EN) |
|---|---|
banner.title |
This website uses cookies |
banner.description |
We use cookies to improve your experience... |
banner.acceptAll |
Accept all |
banner.rejectAll |
Reject all |
banner.customize |
Customise |
preferences.title |
Cookie settings |
preferences.save |
Save settings |
category.necessary |
Necessary |
category.analytics |
Analytics |
category.marketing |
Marketing |
category.functionality |
Functionality |
Adding a new language
If you need a language that is not in the supported list:
- Contact our support at [email protected]
- Alternatively, use custom translations on the Pro plan
RTL languages
Consentio supports right-to-left (RTL) languages:
- Arabic (
ar) - Hebrew (
he) - Persian (
fa)
The banner layout automatically adapts to the text direction.
Language detection
Consentio automatically detects the language from these sources (in order of priority):
-
HTML lang attribute - Highest priority. The widget uses the language
defined in
<html lang="cs">. -
Accept-Language header - If the
langattribute is not set, the widget uses the preferred language from the browser. - Default language - As a fallback, the default language set in the dashboard is used.
lang attribute
on the <html> element according to the current language version of the page.