Fix Klaro translations by forcing Klaro to use a 'zy' language key which DSpace will translate

(cherry picked from commit 6076423907)
This commit is contained in:
Tim Donohue
2024-10-29 13:58:50 -05:00
committed by github-actions[bot]
parent ce010725ac
commit 4353c57cd0
3 changed files with 22 additions and 13 deletions

View File

@@ -91,7 +91,7 @@ export class BrowserKlaroService extends KlaroService {
initialize() {
if (!environment.info.enablePrivacyStatement) {
delete this.klaroConfig.privacyPolicy;
this.klaroConfig.translations.zz.consentNotice.description = 'cookies.consent.content-notice.description.no-privacy';
this.klaroConfig.translations.zy.consentNotice.description = 'cookies.consent.content-notice.description.no-privacy';
}
const hideGoogleAnalytics$ = this.configService.findByPropertyName(this.GOOGLE_ANALYTICS_KEY).pipe(
@@ -238,12 +238,12 @@ export class BrowserKlaroService extends KlaroService {
*/
addAppMessages() {
this.klaroConfig.services.forEach((app) => {
this.klaroConfig.translations.zz[app.name] = {
this.klaroConfig.translations.zy[app.name] = {
title: this.getTitleTranslation(app.name),
description: this.getDescriptionTranslation(app.name)
};
app.purposes.forEach((purpose) => {
this.klaroConfig.translations.zz.purposes[purpose] = this.getPurposeTranslation(purpose);
this.klaroConfig.translations.zy.purposes[purpose] = this.getPurposeTranslation(purpose);
});
});
}
@@ -257,7 +257,7 @@ export class BrowserKlaroService extends KlaroService {
*/
this.translateService.setDefaultLang(environment.defaultLanguage);
this.translate(this.klaroConfig.translations.zz);
this.translate(this.klaroConfig.translations.zy);
}
/**