From 5d7e603357ce70ba8f4ab578a71b562fa601de28 Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Mon, 16 Dec 2024 17:03:17 +0000 Subject: [PATCH 1/2] fix(modaltos): fix translation presentation The Modal Terms of Service was presenting the ` ` when using the pt_pt or pt locales. fccn/nau-technical#367 --- src/_footer.scss | 11 +++++++++++ src/components/modal-tos/ModalToS.jsx | 7 ++++--- src/i18n/messages/pt_PT.json | 8 ++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/_footer.scss b/src/_footer.scss index 13d9e6687..b3c522f0c 100644 --- a/src/_footer.scss +++ b/src/_footer.scss @@ -98,3 +98,14 @@ $footer-links-navigation-color: $footer-text; } } } + +.modal-terms-of-service { + .pgn__form-label{ + .standalone-link { + &:before { + // Add a white space before MODAL TOS checkbox links + content: "\00a0"; + } + } + } +} diff --git a/src/components/modal-tos/ModalToS.jsx b/src/components/modal-tos/ModalToS.jsx index 86fca904f..114b16917 100644 --- a/src/components/modal-tos/ModalToS.jsx +++ b/src/components/modal-tos/ModalToS.jsx @@ -92,6 +92,7 @@ const ModalToS = () => { onClose={close} hasCloseButton={false} size="lg" + className="modal-terms-of-service" > {title[lang] && ( @@ -114,7 +115,7 @@ const ModalToS = () => { createTOSLink(chunks, PRIVACY_POLICY_URL), }} @@ -127,7 +128,7 @@ const ModalToS = () => { createTOSLink(chunks, TERMS_OF_SERVICE_URL), }} @@ -140,7 +141,7 @@ const ModalToS = () => { createTOSLink(chunks, TOS_AND_HONOR_CODE), }} diff --git a/src/i18n/messages/pt_PT.json b/src/i18n/messages/pt_PT.json index f810af5bf..9f530a07e 100644 --- a/src/i18n/messages/pt_PT.json +++ b/src/i18n/messages/pt_PT.json @@ -2,8 +2,8 @@ "footer.languageForm.select.label": "Escolha a língua", "footer.languageForm.submit.label": "Aplicar", "footer.copyright.message": "Todos os direitos reservados.", - "modalToS.dataAuthorization.checkbox.label": "Li e compreendi a Política de Privacidade", - "modalToS.termsOfService.checkbox.label": "Li, compreendi e aceito os Termos e Condições", - "modalToS.honorCode.checkbox.label": "Li e compreendi o Código de Honra", + "modalToS.dataAuthorization.checkbox.label": "Li e compreendi a Política de Privacidade", + "modalToS.termsOfService.checkbox.label": "Li, compreendi e aceito os Termos e Condições", + "modalToS.honorCode.checkbox.label": "Li e compreendi o Código de Honra", "modalToS.acceptance.button": "Aceito os novos termos de serviço" -} + } From 8797c6f39cac6cbf002098376de7ab80f3de384d Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Mon, 16 Dec 2024 17:09:50 +0000 Subject: [PATCH 2/2] fix(modaltos): Translate modal ToS title fccn/nau-technical#367 --- src/components/Footer.jsx | 2 +- src/components/modal-tos/ModalToS.jsx | 12 +++++++++--- src/i18n/messages/pt_PT.json | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 309958b0a..51d6a42cd 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -154,7 +154,7 @@ class SiteFooter extends React.Component { { - config.MODAL_UPDATE_TERMS_OF_SERVICE && + config.MODAL_UPDATE_TERMS_OF_SERVICE && } ); diff --git a/src/components/modal-tos/ModalToS.jsx b/src/components/modal-tos/ModalToS.jsx index 114b16917..608ede5da 100644 --- a/src/components/modal-tos/ModalToS.jsx +++ b/src/components/modal-tos/ModalToS.jsx @@ -2,7 +2,9 @@ import React, { useEffect, useState } from 'react'; import { convertKeyNames, getConfig } from '@edx/frontend-platform'; import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; -import { FormattedMessage, getLocale, injectIntl } from '@edx/frontend-platform/i18n'; +import { + FormattedMessage, getLocale, injectIntl, intlShape, +} from '@edx/frontend-platform/i18n'; import { Button, Form, Hyperlink, ModalDialog, useToggle, useCheckboxSetValues, ActionRow, @@ -21,7 +23,7 @@ const createTOSLink = (chunks, url) => ( ); -const ModalToS = () => { +const ModalToS = ({ intl }) => { const [tosPreference, setTosPreference] = useState(undefined); const [isOpen, open, close] = useToggle(false); const { width } = useWindowSize(); @@ -86,7 +88,7 @@ const ModalToS = () => { return ( { ); }; +ModalToS.propTypes = { + intl: intlShape.isRequired, +}; + export default injectIntl(ModalToS); diff --git a/src/i18n/messages/pt_PT.json b/src/i18n/messages/pt_PT.json index 9f530a07e..58af1cbf6 100644 --- a/src/i18n/messages/pt_PT.json +++ b/src/i18n/messages/pt_PT.json @@ -2,6 +2,7 @@ "footer.languageForm.select.label": "Escolha a língua", "footer.languageForm.submit.label": "Aplicar", "footer.copyright.message": "Todos os direitos reservados.", + "modalToS.modalDialog.title": "Modal aceitar Termos de Serviço", "modalToS.dataAuthorization.checkbox.label": "Li e compreendi a Política de Privacidade", "modalToS.termsOfService.checkbox.label": "Li, compreendi e aceito os Termos e Condições", "modalToS.honorCode.checkbox.label": "Li e compreendi o Código de Honra",