All instructions about how to set up Cookie-Script properly

How to set up cookie consent on multi-language website


Today we are happy to introduce translations - one of the most requested functionalities for Cookie-Script. From now on you can translate a single Cookie-Script item to many languages and the cookie popup will be shown in the proper language automatically. 

You can find all translations for the current item in the Translations tab

How website language is detected? 

There are few ways you can set up Cookie-Script to detect currently selected website language: 

1 Disabled: do not use translations

2 Auto detect language: try to detect language with HTML tag and if that fails, try to detect language with current webpage URL.

3 HTML tag only: This is the most common option. Usually, a website has currently selected language written in HTML tag, which makes it useful for any automated software to detect website language. HTML tag is a top parent element for all other elements on the page.


<html lang="it">

4 Website URL only: Current page link is analyzed for any existing languages, Translation is applied if language code is found in the link. 


would trigger Italian translation since page URL contains /it/

Setting language inside the script tag.

You can also hardcode the language inside the script tag. This might be useful if none of the options above fit your needs. Or if you just want to set the language from a backend. Script tag language will override all other methods. 

Setting language inside the script tag can be done with a data-cs-lang attribute: 

<script type="text/javascript" charset="UTF-8" data-cs-lang="it" 

How do I add new translations?

Adding new translations is pretty straightforward, just click + Add translation button, choose translation language and fill in all the translatable fields. You can add many translations to the same item. If some languages are not needed, you can delete them with Delete translation button.

Note: If the user agreed to cookie usage in one language, his choice will be remembered in other language.
Note: In case certain translation string is not available in translation, original (non translated) text will be used.

Custom languages

We have included all EU languages for selection and also added pre-defined translations for those languages. However if you need to translate Cookie-Script popup to some other language, just choose Other language... in language selector and enter custom language code. 

Update [2020-09-10]: Translating cookie descriptions. 

We are happy to introduce a new feature that will fully automate cookie banner translations. From now on all pre-filled known cookie descriptions will be automatically translated to any EU language that is used in your banner. You can still adjust those translations if needed.