Klaro: Why should we have it, and how to turn it off if we don't need it?

168 views
Skip to first unread message

Carolyn Sullivan

unread,
Feb 25, 2025, 4:23:52 PM2/25/25
to DSpace Technical Support
Hello,

Recently I noticed this pop-up:
KlaroPopup_022525.png
Digging suggests that it's from https://github.com/klaro-org/klaro-js

A few questions:
(1) We don't use Google Analytics or any other services, so I guess we don't need Klaro (am I correct?).  How do I get rid of this pop-up then?  Do I just delete the folder dspace-7-frontend/src/app/shared/cookies (I'm guessing no, deleting stuff seems drastic...)?
(2)  If we did get 'some other service' in the future, how do I edit the translations marked out in dspace-7-frontend/-/blob/master/src/app/shared/cookies/klaro-configuration.ts ?  I see some of the translations marked under zz in the i18n translation pack, but nothing corresponding the 'enable some additional services for'.

Thanks so much for your help!
Carolyn.

DSpace Technical Support

unread,
Feb 27, 2025, 3:41:58 PM2/27/25
to DSpace Technical Support
Hi Carolyn,

Klaro is used to align DSpace with privacy requirements such as GDPR.  Those requirements say that applications must ask for consent before storing any cookies in a user's browser.  DSpace **requires** storing some cookies in a user's browser in order to maintain your session (after authenticating) and similar.  This means that, regardless of whether Google Analytics is used, DSpace still must use Klaro in order to align with GDPR (and similar) regulations. Because DSpace strives to align with GDPR, Klaro is not removable at this time.  (The only way to remove it would be to remove it's code, there is no configuration)

Regarding the missing "translations" for your Klaro popup, that bug was fixed in 7.5 (https://github.com/DSpace/dspace-angular/pull/2031), but also popped up briefly during the 8.1 development (fixed here https://github.com/DSpace/dspace-angular/pull/3625).  I'm guessing maybe you are running code where this bug was not yet fixed.

Tim

Carolyn Sullivan

unread,
Feb 28, 2025, 2:12:57 PM2/28/25
to DSpace Technical Support
Thanks for the clarification, Tim!

So with regard to the absence of any words after 'Hi!  Could we please enable some additional services for [BLANK]?, I'm still confused how we would add custom text for [BLANK].  I checked the pull request you linked, and it looks like we are up to date for that--our src/app/shared/cookies/browser-klaro.service.ts shows:

Klaro_022825.png

There must then just be a variable we haven't assigned a value to yet in the i18n packages... is this it?
Klaro_022825_i18n.png

Or is it some variable in the dspace-7-frontend/-/blob/master/src/app/shared/cookies/browser-klaro.service.spec.ts file?

Thanks so much, 
Carolyn.

DSpace Technical Support

unread,
Feb 28, 2025, 2:36:49 PM2/28/25
to DSpace Technical Support
Hi Carolyn,

The i18n keys that Klaro uses/expects are the ones defined in the klaro-configuration.ts file here:

Each of the strings in that setting is an i18n key that should exist in your en.json5.  If you are missing any, then that may be why your display is not working properly.

In the end, the Klaro popup should look like the one on our demo site: https://demo.dspace.org.   If you already accepted the settings on our demo site, you can access the popup again by clicking on the "Cookie settings" link in the footer.

Tim

Carolyn Sullivan

unread,
Mar 5, 2025, 12:31:28 PM3/5/25
to DSpace Technical Support
Hello Tim,

I took a look at our i18n files.  We're running DSpace 7.6.2 and we have all the i18n labels for cookies listed in the klaro-configuration.ts file you noted above (see attached xlsx doc), except for cookies.consent.app.purposes, but the DSpace 8 i18n files don't have that one either.  

Comparing our pop-up
KlaroPopup_022525.png

to yours

Klaro_030525.png

it looks like the problem SHOULD be your initial suggestion--somehow we're still using the Klaro labels and never incorporated those bug fixes.  But when I check master/src/app/shared/cookies/browser-klaro.service.ts, I see:
Klaro_030525_Klarofixcode1.png
I've attached or browser-klaro.service.ts file, but like... it LOOKS like the patches are present.  So I can't figure out why on earth it's still using the defaults.  Any suggestions?

Also, if we wanted to use our uOttawa brand colours instead of the default DSpace colours for the pop-up, any idea where we'd go to edit the css?  I can't find an Angular component for the pop-up anywhere.

Thanks,
Carolyn.
browser-klaro.service.ts
KlaroKeys_030525.xlsx

DSpace Technical Support

unread,
Mar 5, 2025, 1:30:23 PM3/5/25
to DSpace Technical Support
Hi Carolyn,

I'd recommend also checking your local "klaro-configuration.ts" to make sure it's identical to the one in DSpace 7.6.3, especially the "zy" translations section here: https://github.com/DSpace/dspace-angular/blob/dspace-7_x/src/app/shared/cookies/klaro-configuration.ts#L73-L118

This "klaro-configuration.ts" file provides the settings for Klaro, as Klaro is an external tool/library.  If you somehow have forgotten to merge changes into that file, that could also cause the behavior you are seeing, especially if that "zy" section is wrong or different.

This is also why you won't see a Klaro component, as it's not a component that DSpace has written.  It's an external library we are using that is provided by https://klaro.org/
Therefore, regarding CSS, you'd have to look at Klaro's own CSS.  I *believe* you can override their default CSS styles though by adding new CSS rules in the global DSpace CSS rules.  You also may be able to modify some of the Klaro look & feel via that "klaro-configuration.ts" file -- check the Klaro documentation at https://klaro.org/docs/

Tim

C S

unread,
Mar 5, 2025, 2:17:32 PM3/5/25
to DSpace Technical Support
Hello Tim,

Thanks!  It looks like yeah, the issue is in the klaro-configuration.ts file--we're using zz instead of zy so of course it's using the default Klaro translations.  I'll try fixing that.

Best,
Carolyn.

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dspace-tech/7ebe6151-c1ec-425e-830e-87f738f9c9d9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages