Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Klaro translations by forcing Klaro to use a zy language code that DSpace will translate #3625

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

tdonohue
Copy link
Member

@tdonohue tdonohue commented Nov 8, 2024

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:
klaro-text

The main issue is that the Klaro 'zz' "default translations" no longer seem to work. The reason is because Klaro only uses the zz translations if no other languages can be found, and (as of 0.7.19) the klaro-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 the zz 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 the zy language, and translate it to the user's language as we did before.

Instructions for Reviewers

  • Verify the Klaro cookie popup works as before. It's easiest to verify by opening the homepage in an Incognito window.

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 and dspace-7_x as they all now use Klaro 0.7.21 (and this Klaro bug began with 0.7.19).

@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Nov 8, 2024
@tdonohue tdonohue added this to the 8.1 milestone Nov 8, 2024
@tdonohue
Copy link
Member Author

tdonohue commented Nov 8, 2024

NOTE: This does NOT require porting to main as that branch now uses Orejime (and this bug doesn't exist in that library). See #3199

@tdonohue
Copy link
Member Author

tdonohue commented Nov 8, 2024

This was previously approved in #3586 (comment) So, once this passes tests, it can be merged & ported to dspace-7_x

@tdonohue tdonohue linked an issue Nov 8, 2024 that may be closed by this pull request
@tdonohue tdonohue merged commit 9add368 into DSpace:dspace-8_x Nov 8, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug
Projects
Development

Successfully merging this pull request may close these issues.

Cookie dialog has a strange text in current DSpace 8.1 Snapshot
2 participants