Merge pull request #4217 from Emile840/master

Fix legal notice traduction bug when refreshing sign in page
This commit is contained in:
Lauri Ojansivu 2021-12-06 18:34:54 +02:00 committed by GitHub
commit 66488b834b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -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

View file

@ -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();
},