Skip to content

Commit 66550b5

Browse files
drafishAniket-Engg
authored andcommitted
patch i18n for remixApp
1 parent 088ad33 commit 66550b5

File tree

2 files changed

+48
-22
lines changed

2 files changed

+48
-22
lines changed

apps/remix-ide/src/app/tabs/locales/en/remixApp.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@
77
"remixApp.enterText3": "Learning - discovering web3 development",
88
"remixApp.enterText4": "Prototyping - trying out concepts and techniques",
99
"remixApp.enterText5": "Developing projects - Remix as your main dev tool",
10-
"remixApp.enterText6": "Production - only deployments"
10+
"remixApp.enterText6": "Production - only deployments",
11+
"remixApp.matomoText1": "An Opt-in version of <a>Matomo</a>, an open source data analytics platform is being used to improve Remix IDE.",
12+
"remixApp.matomoText2": "We realize that our users have sensitive information in their code and that their privacy - your privacy - must be protected.",
13+
"remixApp.matomoText3": "All data collected through Matomo is stored on our own server - no data is ever given to third parties.",
14+
"remixApp.matomoText4": "We do not collect nor store any personally identifiable information (PII).",
15+
"remixApp.matomoText5": "For more info, see: <a>Matomo Analytics on Remix iDE</a>.",
16+
"remixApp.matomoText6": "You can change your choice in the Settings panel anytime.",
17+
"remixApp.matomoTitle": "Help us to improve Remix IDE",
18+
"remixApp.accept": "Accept",
19+
"remixApp.decline": "Decline"
1120
}

libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, {useContext, useEffect, useState} from 'react'
2+
import {FormattedMessage} from 'react-intl'
23
import {AppContext} from '../../context/context'
34
import {useDialogDispatchers} from '../../context/provider'
45
declare global {
@@ -9,7 +10,7 @@ declare global {
910
const _paq = (window._paq = window._paq || [])
1011

1112
interface MatomoDialogProps {
12-
okFn: () => void,
13+
okFn: () => void
1314
hide: boolean
1415
}
1516

@@ -22,25 +23,41 @@ const MatomoDialog = (props: MatomoDialogProps) => {
2223
return (
2324
<>
2425
<p>
25-
An Opt-in version of{' '}
26-
<a href="https://matomo.org" target="_blank" rel="noreferrer">
27-
Matomo
28-
</a>
29-
, an open source data analytics platform is being used to improve Remix IDE.
26+
<FormattedMessage
27+
id="remixApp.matomoText1"
28+
values={{
29+
a: (chunks) => (
30+
<a href="https://matomo.org" target="_blank" rel="noreferrer">
31+
{chunks}
32+
</a>
33+
),
34+
}}
35+
/>
3036
</p>
31-
<p>We realize that our users have sensitive information in their code and that their privacy - your privacy - must be protected.</p>
3237
<p>
33-
All data collected through Matomo is stored on our own server - no data is ever given to third parties.
38+
<FormattedMessage id="remixApp.matomoText2" />
3439
</p>
35-
<p>We do not collect nor store any personally identifiable information (PII).</p>
3640
<p>
37-
For more info, see:{' '}
38-
<a href="https://medium.com/p/66ef69e14931/" target="_blank" rel="noreferrer">
39-
Matomo Analytics on Remix iDE
40-
</a>
41-
.
41+
<FormattedMessage id="remixApp.matomoText3" />
42+
</p>
43+
<p>
44+
<FormattedMessage id="remixApp.matomoText4" />
45+
</p>
46+
<p>
47+
<FormattedMessage
48+
id="remixApp.matomoText5"
49+
values={{
50+
a: (chunks) => (
51+
<a href="https://medium.com/p/66ef69e14931/" target="_blank" rel="noreferrer">
52+
{chunks}
53+
</a>
54+
),
55+
}}
56+
/>
57+
</p>
58+
<p>
59+
<FormattedMessage id="remixApp.matomoText6" />
4260
</p>
43-
<p>You can change your choice in the Settings panel anytime.</p>
4461
</>
4562
)
4663
}
@@ -49,26 +66,26 @@ const MatomoDialog = (props: MatomoDialogProps) => {
4966
if (visible && showMatamo) {
5067
modal({
5168
id: 'matomoModal',
52-
title: 'Help us to improve Remix IDE',
69+
title: <FormattedMessage id="remixApp.matomoTitle" />,
5370
message: message(),
54-
okLabel: 'Accept',
71+
okLabel: <FormattedMessage id="remixApp.accept" />,
5572
okFn: handleModalOkClick,
56-
cancelLabel: 'Decline',
57-
cancelFn: declineModal
73+
cancelLabel: <FormattedMessage id="remixApp.decline" />,
74+
cancelFn: declineModal,
5875
})
5976
}
6077
}, [visible])
6178

6279
const declineModal = async () => {
6380
settings.updateMatomoAnalyticsChoice(false)
6481
// revoke tracking consent
65-
_paq.push(['forgetConsentGiven']);
82+
_paq.push(['forgetConsentGiven'])
6683
setVisible(false)
6784
}
6885

6986
const handleModalOkClick = async () => {
7087
// user has given consent to process their data
71-
_paq.push(['setConsentGiven']);
88+
_paq.push(['setConsentGiven'])
7289
settings.updateMatomoAnalyticsChoice(true)
7390
setVisible(false)
7491
props.okFn()

0 commit comments

Comments
 (0)