From 8797c6f39cac6cbf002098376de7ab80f3de384d Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Mon, 16 Dec 2024 17:09:50 +0000 Subject: [PATCH] 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",