Skip to content

Commit 9ac2402

Browse files
authored
Merge branch 'master' into master
2 parents 11cb56e + ee59930 commit 9ac2402

File tree

19 files changed

+351
-294
lines changed

19 files changed

+351
-294
lines changed

apps/remix-ide/src/app/plugins/remixd-handle.tsx

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-unused-vars */
22
import React, {useRef, useState, useEffect} from 'react' // eslint-disable-line
3+
import {FormattedMessage} from 'react-intl'
34
import {WebsocketPlugin} from '@remixproject/engine-web'
45
import * as packageJson from '../../../../../package.json'
56
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
@@ -84,7 +85,7 @@ export class RemixdHandle extends WebsocketPlugin {
8485
console.log(error)
8586
const alert: AlertModal = {
8687
id: 'connectionAlert',
87-
message: 'Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.'
88+
message: window._intl.formatMessage({id: 'remixd.connectionAlert1'}),
8889
}
8990
this.call('notification', 'alert', alert)
9091
this.canceled()
@@ -95,7 +96,7 @@ export class RemixdHandle extends WebsocketPlugin {
9596
clearInterval(intervalId)
9697
const alert: AlertModal = {
9798
id: 'connectionAlert',
98-
message: 'Connection to remixd terminated. Please make sure remixd is still running in the background.'
99+
message: window._intl.formatMessage({id: 'remixd.connectionAlert2'}),
99100
}
100101
this.call('notification', 'alert', alert)
101102
this.canceled()
@@ -115,10 +116,10 @@ export class RemixdHandle extends WebsocketPlugin {
115116
// warn the user only if he/she is in the browser context
116117
const mod: AppModal = {
117118
id: 'remixdConnect',
118-
title: 'Access file system using remixd',
119+
title: window._intl.formatMessage({id: 'remixd.remixdConnect'}),
119120
message: remixdDialog(),
120-
okLabel: 'Connect',
121-
cancelLabel: 'Cancel'
121+
okLabel: window._intl.formatMessage({id: 'remixd.connect'}),
122+
cancelLabel: window._intl.formatMessage({id: 'remixd.cancel'}),
122123
}
123124
const result = await this.call('notification', 'modal', mod)
124125
if (result) {
@@ -159,45 +160,62 @@ function remixdDialog() {
159160
<>
160161
<div className="">
161162
<div className="mb-2 text-break">
162-
Access your local file system from Remix IDE using{' '}
163-
<a target="_blank" href="https://www.npmjs.com/package/@remix-project/remixd">
164-
Remixd NPM package
165-
</a>
166-
.
163+
<FormattedMessage
164+
id="remixd.text1"
165+
values={{
166+
a: (chunks) => (
167+
<a target="_blank" href="https://www.npmjs.com/package/@remix-project/remixd">
168+
{chunks}
169+
</a>
170+
),
171+
}}
172+
/>
167173
</div>
168174
<div className="mb-2 text-break">
169-
Remixd{' '}
170-
<a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html">
171-
documentation
172-
</a>
173-
.
175+
<FormattedMessage
176+
id="remixd.text2"
177+
values={{
178+
a: (chunks) => (
179+
<a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html">
180+
{chunks}
181+
</a>
182+
),
183+
}}
184+
/>
174185
</div>
175186
<div className="mb-2 text-break">
176-
The remixd command is:
187+
<FormattedMessage id="remixd.text3" />
177188
<br />
178189
<b>{commandText}</b>
179190
</div>
180191
<div className="mb-2 text-break">
181-
The remixd command without options uses the terminal's current directory as the shared directory and the shared Remix domain can only be https://remix.ethereum.org,
182-
https://remix-alpha.ethereum.org, or https://remix-beta.ethereum.org
192+
<FormattedMessage id="remixd.text4" />
183193
</div>
184194
<div className="mb-2 text-break">
185-
Example command with flags: <br />
195+
<FormattedMessage id="remixd.text5" /> <br />
186196
<b>{fullCommandText}</b>
187197
</div>
188198
<div className="mb-2 text-break">
189-
For info about ports, see{' '}
190-
<a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage">
191-
Remixd ports usage
192-
</a>
199+
<FormattedMessage
200+
id="remixd.text6"
201+
values={{
202+
a: (chunks) => (
203+
<a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage">
204+
{chunks}
205+
</a>
206+
),
207+
}}
208+
/>
209+
</div>
210+
<div className="mb-2 text-break">
211+
<FormattedMessage id="remixd.text7" />
193212
</div>
194-
<div className="mb-2 text-break">This feature is still in Alpha. We recommend to keep a backup of the shared folder.</div>
195213
<div className="mb-2 text-break">
196214
<h6 className="text-danger">
197-
Before using, make sure remixd version is latest i.e. <b>v{remixdVersion}</b>
215+
<FormattedMessage id="remixd.text8" /> <b>v{remixdVersion}</b>
198216
<br></br>
199217
<a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#update-to-the-latest-remixd">
200-
Read here how to update it
218+
<FormattedMessage id="remixd.text9" />
201219
</a>
202220
</h6>
203221
</div>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"editor.keyboardShortcuts": "Keyboard Shortcuts",
3+
"editor.keyboardShortcuts.text1": "Compile the current contract",
4+
"editor.keyboardShortcuts.text2": "Open the File Explorer",
5+
"editor.keyboardShortcuts.text3": "Open the Plugin Manager",
6+
"editor.keyboardShortcuts.text4": "Compile the current contract & Run an associated script",
7+
"editor.editorKeyboardShortcuts": "Editor Keyboard Shortcuts",
8+
"editor.editorKeyboardShortcuts.text1": "Format the code in the current file",
9+
"editor.importantLinks": "Important Links",
10+
"editor.importantLinks.text1": "Official website about the Remix Project",
11+
"editor.importantLinks.text2": "Official documentation",
12+
"editor.title1": "Pasted Code Alert",
13+
"editor.title1.message1": "You have just pasted a code snippet or contract in the editor.",
14+
"editor.title1.message2": "Make sure you fully understand this code before deploying or interacting with it. Don't get scammed!",
15+
"editor.title1.message3": "Running untrusted code can put your wallet <span> at risk </span>. In a worst-case scenario, you could <span>lose all your money</span>.",
16+
"editor.title1.message4": "If you don't fully understand it, please don't run this code.",
17+
"editor.title1.message5": "If you are not a smart contract developer, ask someone you trust who has the skills to determine if this code is safe to use.",
18+
"editor.title1.message6": "See <a> these recommendations </a> for more information.",
19+
"editor.zoomIn": "Zoom In",
20+
"editor.zoomOut": "Zoom Out",
21+
"editor.formatCode": "Format Code",
22+
"editor.generateDocumentation": "Generate documentation for this function",
23+
"editor.generateDocumentation2": "Generate documentation for the function \"{name}\"",
24+
"editor.generateDocumentationByAI": "solidity code: {content}\n Generate the documentation for the function {currentFunction} using the Doxygen style syntax",
25+
"editor.explainFunction": "Explain this function",
26+
"editor.explainFunction2": "Explain the function \"{name}\"",
27+
"editor.explainFunctionByAI": "solidity code: {content}\n Explain the function {currentFunction}",
28+
"editor.executeFreeFunction": "Run a free function",
29+
"editor.executeFreeFunction2": "Run the free function \"{name}\"",
30+
"editor.toastText1": "This can only execute free function",
31+
"editor.toastText2": "Please go to Remix settings and activate the code editor features or wait that the current editor context is loaded.",
32+
"editor.text": "The file is opened in <b>read-only</b> mode."
33+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"home.home": "Home",
23
"home.scamAlert": "Scam Alert",
34
"home.scamAlertText": "The only URL Remix uses is remix.ethereum.org",
45
"home.scamAlertText2": "Beware of online videos promoting \"liquidity front runner bots\"",
Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
1-
import debuggerJson from './debugger.json';
2-
import filePanelJson from './filePanel.json';
3-
import homeJson from './home.json';
4-
import panelJson from './panel.json';
5-
import pluginManagerJson from './pluginManager.json';
6-
import searchJson from './search.json';
7-
import settingsJson from './settings.json';
8-
import solidityJson from './solidity.json';
9-
import terminalJson from './terminal.json';
10-
import udappJson from './udapp.json';
11-
import solidityUnitTestingJson from './solidityUnitTesting.json';
12-
import permissionHandlerJson from './permissionHandler.json';
13-
import electronJson from './electron.json';
14-
import solUmlGenJson from './solUmlGen.json'
15-
import remixAppJson from './remixApp.json'
16-
import remixUiTabsJson from './remixUiTabs.json'
17-
import circuitJson from './circuit.json';
1+
function readAndCombineJsonFiles() {
2+
const dataContext = require.context('./', true, /\.json$/)
183

19-
export default {
20-
...debuggerJson,
21-
...filePanelJson,
22-
...homeJson,
23-
...panelJson,
24-
...pluginManagerJson,
25-
...searchJson,
26-
...settingsJson,
27-
...solidityJson,
28-
...terminalJson,
29-
...udappJson,
30-
...solidityUnitTestingJson,
31-
...permissionHandlerJson,
32-
...electronJson,
33-
...solUmlGenJson,
34-
...remixAppJson,
35-
...remixUiTabsJson,
36-
...circuitJson
4+
let combinedData = {}
5+
dataContext.keys().forEach((key) => {
6+
const jsonData = dataContext(key)
7+
combinedData = {...combinedData, ...jsonData}
8+
})
9+
10+
return combinedData
3711
}
12+
13+
export default readAndCombineJsonFiles()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"publishToStorage.title1": "Publish To Storage",
3+
"publishToStorage.title1.message": "This contract may be abstract, it may not implement an abstract parent's methods completely or it may not invoke an inherited contract's constructor correctly.",
4+
"publishToStorage.title2": "Published {name}'s Metadata and Sources",
5+
"publishToStorage.title2.message": "Metadata and sources of \"{name}\" were published successfully.",
6+
"publishToStorage.title3": "Swarm Publish Failed",
7+
"publishToStorage.title4": "IPFS Settings",
8+
"publishToStorage.title4.message1": "You have not set your own custom IPFS settings.",
9+
"publishToStorage.title4.message2": "We won’t be providing a public endpoint anymore for publishing your contracts to IPFS.",
10+
"publishToStorage.title4.message3": "Instead of that, 4 options are now available:",
11+
"publishToStorage.title4.message4": "DEFAULT OPTION: Use the public INFURA node. This will not guarantee your data will persist.",
12+
"publishToStorage.title4.message5": "Use your own INFURA IPFS node. This requires a subscription. <a>Learn more</a>",
13+
"publishToStorage.title4.message6": "Use any external IPFS which doesn’t require any authentification.",
14+
"publishToStorage.title4.message7": "Use your own local ipfs node (which usually runs under http://localhost:5001)",
15+
"publishToStorage.title4.message8": "You can update your IPFS settings in the SETTINGS tab.",
16+
"publishToStorage.title4.message9": "Now the default option will be used.",
17+
"publishToStorage.title5": "IPFS Publish Failed",
18+
"publishToStorage.title5.message": "Failed to publish metadata file and sources to {storage}, please check the {storage} gateways is available."
19+
}
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
{
2-
"remixApp.scrollToSeeAllTabs": "Scroll to see all tabs"
2+
"remixApp.scrollToSeeAllTabs": "Scroll to see all tabs",
3+
"remixApp.alert": "Alert",
4+
"remixApp.ok": "OK",
5+
"remixApp.enterText1": "Welcome to Remix IDE",
6+
"remixApp.enterText2": "In order to understand your needs better, we would like to know how you typically use Remix",
7+
"remixApp.enterText3": "Learning - discovering web3 development",
8+
"remixApp.enterText4": "Prototyping - trying out concepts and techniques",
9+
"remixApp.enterText5": "Developing projects - Remix as your main dev tool",
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"
320
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"remixd.connectionAlert1": "Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.",
3+
"remixd.connectionAlert2": "Connection to remixd terminated. Please make sure remixd is still running in the background.",
4+
"remixd.remixdConnect": "Access file system using remixd",
5+
"remixd.connect": "Connect",
6+
"remixd.cancel": "Cancel",
7+
"remixd.text1": "Access your local file system from Remix IDE using <a>Remixd NPM package</a>.",
8+
"remixd.text2": "Remixd <a>documentation</a>.",
9+
"remixd.text3": "The remixd command is:",
10+
"remixd.text4": "The remixd command without options uses the terminal's current directory as the shared directory and the shared Remix domain can only be https://remix.ethereum.org, https://remix-alpha.ethereum.org, or https://remix-beta.ethereum.org",
11+
"remixd.text5": "Example command with flags:",
12+
"remixd.text6": "For info about ports, see <a>Remixd ports usage</a>",
13+
"remixd.text7": "This feature is still in Alpha. We recommend to keep a backup of the shared folder.",
14+
"remixd.text8": "Before using, make sure remixd version is latest i.e.",
15+
"remixd.text9": "Read here how to update it"
16+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"solidity.displayName": "Solidity compiler",
3+
"solidity.openaigptMessage": "solidity code: {content}\n error message: {messageText}\n explain why the error occurred and how to fix it.",
34

45
"solidity._comment_compiler-container.tsx": "libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx",
56
"solidity.compiler": "Compiler",
Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
1-
import debuggerJson from './debugger.json';
2-
import filePanelJson from './filePanel.json';
3-
import homeJson from './home.json';
4-
import panelJson from './panel.json';
5-
import pluginManagerJson from './pluginManager.json';
6-
import searchJson from './search.json';
7-
import settingsJson from './settings.json';
8-
import solidityJson from './solidity.json';
9-
import terminalJson from './terminal.json';
10-
import udappJson from './udapp.json';
11-
import solidityUnitTestingJson from './solidityUnitTesting.json';
12-
import permissionHandlerJson from './permissionHandler.json';
13-
import solUmlGenJson from './solUmlGen.json'
14-
import remixAppJson from './remixApp.json'
15-
import remixUiTabsJson from './remixUiTabs.json'
16-
import enJson from '../en';
1+
import enJson from '../en'
2+
3+
function readAndCombineJsonFiles() {
4+
const dataContext = require.context('./', true, /\.json$/)
5+
6+
let combinedData = {}
7+
dataContext.keys().forEach((key) => {
8+
const jsonData = dataContext(key)
9+
combinedData = {...combinedData, ...jsonData}
10+
})
11+
12+
return combinedData
13+
}
1714

1815
// There may have some un-translated content. Always fill in the gaps with EN JSON.
1916
// No need for a defaultMessage prop when render a FormattedMessage component.
20-
export default Object.assign({}, enJson, {
21-
...debuggerJson,
22-
...filePanelJson,
23-
...homeJson,
24-
...panelJson,
25-
...pluginManagerJson,
26-
...searchJson,
27-
...settingsJson,
28-
...solidityJson,
29-
...terminalJson,
30-
...udappJson,
31-
...solidityUnitTestingJson,
32-
...permissionHandlerJson,
33-
...solUmlGenJson,
34-
...remixAppJson,
35-
...remixUiTabsJson,
36-
})
17+
export default Object.assign({}, enJson, readAndCombineJsonFiles())
Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
1-
import debuggerJson from './debugger.json';
2-
import filePanelJson from './filePanel.json';
3-
import homeJson from './home.json';
4-
import panelJson from './panel.json';
5-
import pluginManagerJson from './pluginManager.json';
6-
import searchJson from './search.json';
7-
import settingsJson from './settings.json';
8-
import solidityJson from './solidity.json';
9-
import terminalJson from './terminal.json';
10-
import udappJson from './udapp.json';
11-
import solidityUnitTestingJson from './solidityUnitTesting.json';
12-
import permissionHandlerJson from './permissionHandler.json';
13-
import solUmlGenJson from './solUmlGen.json'
14-
import remixAppJson from './remixApp.json'
15-
import remixUiTabsJson from './remixUiTabs.json'
16-
import enJson from '../en';
1+
import enJson from '../en'
2+
3+
function readAndCombineJsonFiles() {
4+
const dataContext = require.context('./', true, /\.json$/)
5+
6+
let combinedData = {}
7+
dataContext.keys().forEach((key) => {
8+
const jsonData = dataContext(key)
9+
combinedData = {...combinedData, ...jsonData}
10+
})
11+
12+
return combinedData
13+
}
1714

1815
// There may have some un-translated content. Always fill in the gaps with EN JSON.
1916
// No need for a defaultMessage prop when render a FormattedMessage component.
20-
export default Object.assign({}, enJson, {
21-
...debuggerJson,
22-
...filePanelJson,
23-
...homeJson,
24-
...panelJson,
25-
...pluginManagerJson,
26-
...searchJson,
27-
...settingsJson,
28-
...solidityJson,
29-
...terminalJson,
30-
...udappJson,
31-
...solidityUnitTestingJson,
32-
...permissionHandlerJson,
33-
...solUmlGenJson,
34-
...remixAppJson,
35-
...remixUiTabsJson,
36-
})
17+
export default Object.assign({}, enJson, readAndCombineJsonFiles())

0 commit comments

Comments
 (0)