[MM-14058] Add support for i18n (#2190)

* Add language files

* Add react-intl, mmjstool, setup for adding translations

* Translated main module

* Translations for renderer

* A few minor fixes

* More fixes

* Add CI, add missing menu translations, other cleanup

* Added setting to manually select the language of the app

* Force English for E2e

* Unit tests

* Fix mmjstool

* Move set language to before update menu

* PR feedback
This commit is contained in:
Devin Binnie
2022-07-14 11:04:18 -04:00
committed by GitHub
parent 22c97591d5
commit 59e4e7e516
92 changed files with 3554 additions and 2375 deletions

View File

@@ -4,6 +4,7 @@
import React from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage, useIntl} from 'react-intl';
import DestructiveConfirmationModal from './DestructiveConfirmModal';
@@ -13,27 +14,36 @@ type Props = {
onHide: () => void;
onAccept: React.MouseEventHandler<HTMLButtonElement>;
onCancel: React.MouseEventHandler<HTMLButtonElement>;
}
};
export default function RemoveServerModal(props: Props) {
function RemoveServerModal(props: Props) {
const intl = useIntl();
const {serverName, ...rest} = props;
return (
<DestructiveConfirmationModal
{...rest}
title='Remove Server'
acceptLabel='Remove'
cancelLabel='Cancel'
title={intl.formatMessage({id: 'renderer.components.removeServerModal.title', defaultMessage: 'Remove Server'})}
acceptLabel={intl.formatMessage({id: 'label.remove', defaultMessage: 'Remove'})}
cancelLabel={intl.formatMessage({id: 'label.cancel', defaultMessage: 'Cancel'})}
body={(
<Modal.Body>
<p>
{'This will remove the server from your Desktop App but will not delete any of its data' +
' - you can add the server back to the app at any time.'}
<FormattedMessage
id='renderer.components.removeServerModal.body'
defaultMessage='This will remove the server from your Desktop App but will not delete any of its data - you can add the server back to the app at any time.'
/>
</p>
<p>
{'Confirm you wish to remove the '}<strong>{serverName}</strong>{' server?'}
<FormattedMessage
id='renderer.components.removeServerModal.confirm'
defaultMessage='Confirm you wish to remove the {serverName} server?'
values={{serverName}}
/>
</p>
</Modal.Body>
)}
/>
);
}
export default RemoveServerModal;