Skip to content

Commit

Permalink
fix(modaltos): Translate modal ToS title
Browse files Browse the repository at this point in the history
  • Loading branch information
igobranco committed Dec 16, 2024
1 parent 5d7e603 commit 8797c6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class SiteFooter extends React.Component {
</section>
<AdditionalLogosSection />
{
config.MODAL_UPDATE_TERMS_OF_SERVICE && <ModalToS />
config.MODAL_UPDATE_TERMS_OF_SERVICE && <ModalToS intl={intl} />
}
</footer>
);
Expand Down
12 changes: 9 additions & 3 deletions src/components/modal-tos/ModalToS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,7 +23,7 @@ const createTOSLink = (chunks, url) => (
</Hyperlink>
);

const ModalToS = () => {
const ModalToS = ({ intl }) => {
const [tosPreference, setTosPreference] = useState(undefined);
const [isOpen, open, close] = useToggle(false);
const { width } = useWindowSize();
Expand Down Expand Up @@ -86,7 +88,7 @@ const ModalToS = () => {

return (
<ModalDialog
title="Modal Terms of Service"
title={intl.formatMessage({ id: 'modalToS.modalDialog.title', description: 'The Modal Terms of Service Title', defaultMessage: 'Modal accept Terms of Service' })}
isBlocking
isOpen={isOpen}
onClose={close}
Expand Down Expand Up @@ -169,4 +171,8 @@ const ModalToS = () => {
);
};

ModalToS.propTypes = {
intl: intlShape.isRequired,
};

export default injectIntl(ModalToS);
1 change: 1 addition & 0 deletions src/i18n/messages/pt_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a>Política de Privacidade</a>",
"modalToS.termsOfService.checkbox.label": "Li, compreendi e aceito os <a>Termos e Condições</a>",
"modalToS.honorCode.checkbox.label": "Li e compreendi o <a>Código de Honra</a>",
Expand Down

0 comments on commit 8797c6f

Please sign in to comment.