Support multilingual load of usercentrics script

Created on 28 January 2025, 2 months ago

Problem/Motivation

Currently the script is loaded without a language declaration. So the contents of usercentrics will in most cases follow the browser language while this would best be the language of the current page.

Steps to reproduce

Install module and configure
Have a multilingual setup
Visit the page in another language than the default English installation
Remark: You need to enable languages in your usercentrics setup

Proposed resolution

Pass along the required parameters, see https://usercentrics.atlassian.net/wiki/spaces/SKB/pages/1183678648/How+...

Remaining tasks

  • Provide patch
  • Test & review
  • Make a release
Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium kevinvb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kevinvb
  • Merge request !3#3502784 - add multilingual support → (Open) created by Unnamed author
  • 🇧🇪Belgium kevinvb

    Created a MR with the changes to have multilingual support for the usercentrics script.

  • Pipeline finished with Failed
    2 months ago
    Total: 264s
    #408196
  • 🇩🇪Germany jan kellermann

    Thank you very much for this issue and the MR.

    The parameter data-tcf-enabled should not be hard-coded, there is a setting fot this paramater and will be added optionally in line 106ff.

    In most cases the consent dialog should be in browser's language, so this should be implemented as an adjustable option.

  • 🇧🇪Belgium kevinvb

    Indeed, I completely missed that tcf_enabled flag.

    I know browser language is often used as the language of the cookie banner but this is often seen as a bug for clients as they want to have the banner follow the language of the site. So maybe a settings like a toggle to enable the interface language as the language of the consent dialog?

    Normally Drupal has 'languages:language_interface' as a default cache context, not having that cache context in a multilingual setup will break like any usage of t(). So I'm not really sure if we need to add this too.

Production build 0.71.5 2024