Skip to content

Commit

Permalink
Refactor cookie banner code to update language settings parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
felixaschultz committed Aug 23, 2024
1 parent 04c05a9 commit cced014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions dev/gdpr.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -1352,13 +1352,15 @@ intaStyleLink.type = 'text/css';
intaStyleLink.href = 'https://downloads.intastellarsolutions.com/css/gdpr/banner.css?v=' + new Date().getTime();
intaStyleLink.media = 'all';
intHead.insertBefore(intaStyleLink, document.currentScript.previousSibling);
window.INTA.settings.lang = window.INTA?.settings?.language;
window.INTA.settings.language = typeof window.INTA?.settings?.language === "undefined" ?
window.INTA?.settings?.lang : window.INTA?.settings?.language;

const intastellarCookieLanguage
= window.intastellarCookieLanguage
= window.INTA?.settings === undefined
|| window.INTA?.settings?.lang === "auto"
|| window.INTA?.settings?.lang === ""
|| window.INTA?.settings?.lang === undefined
|| window.INTA?.settings?.language === "auto"
|| window.INTA?.settings?.language === ""
|| window.INTA?.settings?.language === undefined
? document.querySelector("html").getAttribute("lang")
: window.INTA?.settings?.language == "german" ? "de"
: window.INTA?.settings?.language == "danish" ? "da"
Expand Down
Loading

0 comments on commit cced014

Please sign in to comment.