It is possible for cookiebot to use the data-culture attribute. The attached patch creates a possibillity for this. There is a checkbox added to the admin screen, if enabled the current language is added to the attribute.

Comments

fabianderijk created an issue. See original summary.

ralphvdhoudt’s picture

Status: Active » Needs review
StatusFileSize
new2.04 KB

The patch was nog fully correct, updated the patch to have a working version

a.milkovsky’s picture

Status: Needs review » Needs work
+++ b/cookiebot.module
@@ -79,19 +79,28 @@ function cookiebot_theme($existing, $type, $theme, $path) {
+  jQuery('script').last().replaceWith('<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" $culture_attr data-cbid="$cbid" type="text/javascript" async>');

This may throw an notice that $culture_attr is not set.

+++ b/cookiebot.admin.inc
@@ -32,6 +32,14 @@ function cookiebot_settings_form($form, &$form_state) {
+    '#title' => t('Force the cookiebot to use the current language'),

Let's add some description here to describe why is it needed to force cookiebot to do something.

In general what do you think if we make it another way: we can add a setting "Cookiebot language" where user may select a language with an additional option "Use current Drupal language'".

anybody’s picture

This needs a complete rewrite now against the latest 7.x version which has a better mechanism to add uc.js to head. This will make things much cleaner and easier. The idea for language selection on #3 is good, but might also be overengineered for aging Drupal 7. What would indeed be important is a better description.

anybody’s picture

@fabianderijk or @ralphvdhoudt any plans to work on this?