From 8752225409269ffbb2b3e3d061f1b692edb07eaa Mon Sep 17 00:00:00 2001 From: Emile NDAGIJIMANA Date: Mon, 6 Dec 2021 15:03:42 +0100 Subject: [PATCH] Fix legal notice traduction bug (when refreshing sign in page, legal notice line was always in english even if a given language isn't english --- client/components/main/layouts.jade | 6 ++++-- client/components/main/layouts.js | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index 197e64645..fcdd8aa4f 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -50,9 +50,11 @@ template(name="userFormsLayout") +connectionMethod(authenticationMethod=currentSetting.defaultAuthenticationMethod) if isLegalNoticeLinkExist div#legalNoticeDiv - span {{_ 'acceptance_of_our_legalNotice'}} - a.at-link(href="{{currentSetting.legalNotice}}", target="_blank", rel="noopener noreferrer") + span#legalNoticeSpan {{_ 'acceptance_of_our_legalNotice'}} + a#legalNoticeAtLink.at-link(href="{{currentSetting.legalNotice}}", target="_blank", rel="noopener noreferrer") | {{_ 'legalNotice'}} + if getLegalNoticeWithWritTraduction + div div.at-form-lang select.select-lang.js-userform-set-language each languages diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js index 2ed92989c..8a93cf047 100644 --- a/client/components/main/layouts.js +++ b/client/components/main/layouts.js @@ -86,6 +86,18 @@ Template.userFormsLayout.helpers({ return false; }, + getLegalNoticeWithWritTraduction(){ + let spanLegalNoticeElt = $("#legalNoticeSpan"); + if(spanLegalNoticeElt != null && spanLegalNoticeElt != undefined){ + spanLegalNoticeElt.html(TAPi18n.__('acceptance_of_our_legalNotice', {}, T9n.getLanguage() || 'en')); + } + let atLinkLegalNoticeElt = $("#legalNoticeAtLink"); + if(atLinkLegalNoticeElt != null && atLinkLegalNoticeElt != undefined){ + atLinkLegalNoticeElt.html(TAPi18n.__('legalNotice', {}, T9n.getLanguage() || 'en')); + } + return true; + }, + isLoading() { return Template.instance().isLoading.get(); },