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 #3586

Closed
wants to merge 1 commit into from

Conversation

tdonohue
Copy link
Member

@tdonohue tdonohue commented Oct 29, 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 port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Oct 29, 2024
@tdonohue tdonohue added this to the 9.0 milestone Oct 29, 2024
@tdonohue tdonohue changed the title Fix Klaro translations by forcing Klaro to use a 'zy' language key which DSpace will translate Fix Klaro translations by forcing Klaro to use a zy language code that DSpace will translate Oct 29, 2024
@MW3000
Copy link
Contributor

MW3000 commented Nov 6, 2024

I cherrypicked the commit to DSpace 8 and it worked and fixed the problem. 👍

Copy link

github-actions bot commented Nov 8, 2024

Hi @tdonohue,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue
Copy link
Member Author

tdonohue commented Nov 8, 2024

Closing, as this needs to be implemented for only dspace-8_x and dspace-7_x because main is now using Orejime (see #3199)

@tdonohue tdonohue closed this Nov 8, 2024
@tdonohue tdonohue removed this from the 9.0 milestone Nov 8, 2024
@alexandrevryghem alexandrevryghem removed port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Nov 17, 2024
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 merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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