dobarkod / cookie-banner

JavaScript based cookie-info banner for complying with EU cookie law
MIT License
425 stars 85 forks source link

Internationalizations support for multi language #19

Closed StErMi closed 7 years ago

StErMi commented 9 years ago

Hi is there a way to pass to this script a variable body message and "Learn More"? We need to provide this feature for different languages.

Thank you very much

zytzagoo commented 9 years ago

Might be a bit late, but for anyone else that might land here from Google or similar, this is/was working/supported out-of-the-box:

https://github.com/dobarkod/cookie-banner#options

The markup ends up being something like this for Italian (via Google Translate):

<script id="cookiebanner" src="..." data-message="Utilizziamo i cookie per migliorare la vostra esperienza. Continuando a visitare questo sito l'utente accetta di utilizzare i cookie." data-linkmsg="saperne di più"></script>

Or like this for German (also via Google Translate):

<script id="cookiebanner" src="..." data-message="Wir verwenden Cookies, um Ihre Erfahrungen zu verbessern. Durch die fortgesetzte dieser Website erklären Sie sich mit der Verwendung von Cookies zu besuchen." data-linkmsg="Erfahren Sie mehr"></script>

etc...

facundofarias commented 9 years ago

Right. That's what we are doing, just setting the data-message depending on the language. :+1: