Text translations for laguages with scriptcode part are not loaded

Created on 13 August 2024, 4 months ago

Problem/Motivation

The klaro.js library uses only the langcode and ignores the
script code
e.g. zh-hans is converted to just zh.
The drupal module loads the configured text translations under zh-hans
which the klaro js library does not find
Resulting in all texts being the the library defaults, not the configured translations.

Steps to reproduce

- Enable zh-hans language
- configure the klaro translations for it (change in "Consent notice > Caption" should be the most obvious to see)
- check that the text does not change in the frontend

Proposed resolution

use only the langcode without scriptcode part when loading the config.
(on sites where multiple languages have the same langcode but different scriptcode this will be unreliable)

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024