Fix Klaro translations by forcing Klaro to use a zy language code that DSpace will translate #3625
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Description
After upgrading to Klaro 0.7.19 (or later), our custom message translations are no longer loading into Klaro. This can be seen on both https://sandbox.dspace.org and https://demo.dspace.org because the Klaro Cookie pop-up shows the default Klaro text like this:
The main issue is that the Klaro
'zz'
"default translations" no longer seem to work. The reason is because Klaro only uses thezz
translations if no other languages can be found, and (as of 0.7.19) theklaro-no-translations
package is wrongly including all the translations (see klaro-org/klaro-js#515). So, there's no longer a way to tell Klaro to not include translations and therefore to only use thezz
language code.This PR fixes the issue by changing our Klaro configuration to force Klaro to always use a (different, fake) language code of
zy
. In our Klaro configuration, we then use our i18n keys for thezy
language, and translate it to the user's language as we did before.Instructions for Reviewers
This bug does NOT impact 7.6.2 or 8.0 (as they both used Klaro 0.7.18). However, it does impact
main
,dspace-8_x
anddspace-7_x
as they all now use Klaro 0.7.21 (and this Klaro bug began with 0.7.19).