From 2a8464001efce8c76e8109af7eb68d9e86105692 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 28 Oct 2021 17:08:13 +0200 Subject: chore: add legal notice In France, legal notice is required for any website. --- htdocs/src/js/app.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'htdocs/src/js/app.js') diff --git a/htdocs/src/js/app.js b/htdocs/src/js/app.js index efb4c33..4f5f5a5 100644 --- a/htdocs/src/js/app.js +++ b/htdocs/src/js/app.js @@ -327,6 +327,18 @@ function printRequestedPage() { } } +/** + * Replace the legal notice link and text. + */ +function replaceLegalNoticeLink() { + const link = document.querySelector('.nav__link--legal'); + link.href = translate('footer.legalNotice.link'); + link.textContent = translate('footer.legalNotice.txt'); +} + +/** + * Translate all text available in HTML templates. + */ function translateHTMLContent() { const brandingDesc = document.querySelector('.branding__description'); const navLabel = document.querySelector('.nav__label'); @@ -335,7 +347,7 @@ function translateHTMLContent() { brandingDesc.textContent = translate('branding.description'); navLabel.textContent = translate('nav.title'); license.title = translate('footer.license'); - instructions.textContent = translate('main.instructions'); + if (instructions) instructions.textContent = translate('main.instructions'); } /** @@ -357,6 +369,7 @@ function setAppLocale() { function init() { setAppLocale(); translateHTMLContent(); + replaceLegalNoticeLink(); loadWebpackStyles(); printProjectsNav(); updateView(); -- cgit v1.2.3