Pop-up script
To implement the consent pop-up in the source code, insert the script as high in the website's <head> tag in the HTML code as possible.
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>
Selecting language
The data-culture= "EN" controls the languages (in this case, it is calling the English language). To change the language, set the data-culture attribute to a different language code using the table below. Make sure that the selected languages are enabled in the "Languages and Settings" under the specific consent solution in the Cookie Information Platform.
Set up the language in your CMS.
When using either the pop-up script or policy-script, you define which language to pull from the consent solution by entering a two-letter ISO language code in the data-culture attribute on the scripts. Using server-side code, like PHP or asp .NET, you can store a dynamic language code. This code can be pulled from the CMS or language plugin of your choice and applied as a variable in the data-culture attribute.
Example from WordPress
<?php $languageCode = substr(get_locale(), 0, 2 ); ?> <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="<?php echo $languageCode; ?>" type="text/javascript"></script>
Example from Joomla:
<?php $lang = JFactory::getLanguage(); $languages = JLanguageHelper::getLanguages('lang_code'); $languageCode = $languages[$lang->getTag()]->sef;?> <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="<?php echo $languageCode ?>" type="text/javascript"></script>
The examples above are based on a PHP created CMS and will differ from other server-side frameworks. We suggest you consult with your agency or developer on how it would work on your CMS.
Language codes
Data-culture | Language | Data-culture | Language |
AR | Arabic | KL | Greenlandic |
BG | Bulgarian | LT | Lithuanian |
CA | Catalan, Valencian | LV | Latvian |
CS | Czech | MS | Malay |
DA | Danish | NB | Norwegian Bokmål |
DE | German | NL | Dutch, Flemish |
EL | Modern Greek | PL | Polish |
EN | English | PT | Portuguese |
ES | Spanish, Castilian | RO | Romanian |
ET | Estonian | RU | Russian |
FI | Finnish | SK | Slovak |
FR | French | SL | Slovene |
HE | Modern Hebrew | SQ | Albanian |
HI | Hindi | SR | Serbian |
HR | Croatian | SV | Swedish |
HU | Hungarian | TH | Thai |
ID | Indonesian | TR | Turkish |
IS | Icelandic | TW | Taiwanese |
IT | Italian | UK | Ukrainian |
JA | Japanese | VI | Vietnamese |
KO | Korean | ZH | Chinese |
Related articles: