Skip to content

Commit 0ce8566

Browse files
committed
Include overrides when loading full experience (#5333)
1 parent c00dcf6 commit 0ce8566

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The types of changes are:
2828
- Fix issue with fides-js where the experience was incorrectly initialized as an empty object which appeared valid, when `undefined` was expected [#5309](https://github.com/ethyca/fides/pull/5309)
2929
- Fix issue where newly added languages in Admin-UI were not being rendered in the preview [#5316](https://github.com/ethyca/fides/pull/5316)
3030
- Fix bug where consent automation accordion shows for integrations that don't support consent automation [#5330](https://github.com/ethyca/fides/pull/5330)
31+
- Fix issue where custom overrides (title, description, privacy policy url, etc.) were not being applied to the full TCF overlay [#5333](https://github.com/ethyca/fides/pull/5333)
3132

3233

3334
### Added

clients/fides-js/src/components/tcf/TcfOverlay.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const TcfOverlay = ({
5656
cookie,
5757
savedConsent,
5858
propertyId,
59+
translationOverrides,
5960
}: TcfOverlayProps) => {
6061
const {
6162
i18n,
@@ -144,7 +145,7 @@ export const TcfOverlay = ({
144145
const fullExperience: PrivacyExperience = { ...result, ...userPrefs };
145146

146147
setExperience(fullExperience);
147-
loadMessagesFromExperience(i18n, fullExperience);
148+
loadMessagesFromExperience(i18n, fullExperience, translationOverrides);
148149
if (!userlocale || bestLocale === defaultLocale) {
149150
// English (default) GVL translations are part of the full experience, so we load them here.
150151
loadGVLMessagesFromExperience(i18n, fullExperience);

clients/fides-js/src/components/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type {
22
FidesCookie,
3+
FidesExperienceTranslationOverrides,
34
FidesInitOptions,
45
NoticeConsent,
56
PrivacyExperience,
@@ -21,4 +22,5 @@ export interface OverlayProps {
2122
fidesRegionString: string;
2223
savedConsent: NoticeConsent;
2324
propertyId?: string;
25+
translationOverrides?: Partial<FidesExperienceTranslationOverrides>;
2426
}

clients/fides-js/src/lib/initOverlay.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const initOverlay = async ({
2929
savedConsent,
3030
renderOverlay,
3131
propertyId,
32+
translationOverrides,
3233
}: OverlayProps & {
3334
renderOverlay: (props: OverlayProps, parent: ContainerNode) => void;
3435
}): Promise<void> => {
@@ -152,6 +153,7 @@ export const initOverlay = async ({
152153
cookie,
153154
savedConsent,
154155
propertyId,
156+
translationOverrides,
155157
},
156158
parentElem,
157159
);

clients/fides-js/src/lib/initialize.ts

+1
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ export const initialize = async ({
459459
savedConsent: fides.saved_consent,
460460
renderOverlay,
461461
propertyId,
462+
translationOverrides: overrides?.experienceTranslationOverrides,
462463
}).catch((e) => {
463464
debugLog(options.debug, e);
464465
});

0 commit comments

Comments
 (0)