From 9e99d6672812a0a1c996c5e1adee563ea07e076a Mon Sep 17 00:00:00 2001 From: drafish Date: Sun, 27 Nov 2022 21:52:19 +0800 Subject: [PATCH 01/11] finish homeTab intl --- apps/remix-ide/src/app/tabs/locales/en-US.js | 42 +++++++++++++++++++ apps/remix-ide/src/app/tabs/locales/zh-CN.js | 40 ++++++++++++++++++ .../src/lib/components/homeTabFeatured.tsx | 33 +++++++++------ .../lib/components/homeTabFeaturedPlugins.tsx | 13 +++--- .../src/lib/components/homeTabFile.tsx | 2 +- .../src/lib/components/homeTabGetStarted.tsx | 20 +++++---- .../src/lib/components/homeTabLearn.tsx | 41 +++++++++++++----- .../src/lib/components/homeTabTitle.tsx | 38 +++++++++++------ 8 files changed, 177 insertions(+), 52 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en-US.js b/apps/remix-ide/src/app/tabs/locales/en-US.js index f1dac06709..d72688ad38 100644 --- a/apps/remix-ide/src/app/tabs/locales/en-US.js +++ b/apps/remix-ide/src/app/tabs/locales/en-US.js @@ -71,7 +71,49 @@ export default { 'home.scamAlertText3': 'Additional safety tips', 'home.learnMore': 'Learn more', 'home.here': 'here', + 'home.more': 'More', + 'home.featured': 'Featured', + 'home.jumpIntoWeb3': 'JUMP INTO WEB3', + 'home.jumpIntoWeb3Text': `The Remix Project is a rich toolset which can be used for the entire journey of contract development by users of any knowledge level, + and as a learning lab for teaching and experimenting with Ethereum.`, + 'home.remixRewards': 'REMIX REWARDS', + 'home.remixRewardsText1': 'NFTs for our users!', + 'home.remixRewardsText2': `Remix Project rewards contributors, beta testers, and UX research participants with NFTs deployed on Optimism. + Remix Reward holders are able to mint a second “Remixer” user NFT badge to give to any other user of their choice.`, + 'home.betaTesting': 'BETA TESTING', + 'home.betaTestingText1': 'Our community supports us.', + 'home.betaTestingText2': 'You can join Beta Testing before each release of Remix IDE. Help us test now and get a handle on new features!', 'home.featuredPlugins': 'Featured Plugins', + 'home.solidityPluginDesc': 'Compile, test and analyse smart contract.', + 'home.starkNetPluginDesc': 'Compile and deploy contracts with Cairo, a native language for StarkNet.', + 'home.solhintPluginDesc': 'Solhint is an open source project for linting Solidity code.', + 'home.sourcifyPluginDesc': 'Solidity contract and metadata verification service.', + 'home.unitTestPluginDesc': 'Write and run unit tests for your contracts in Solidity.', + 'home.getStarted': 'Get Started', + 'home.projectTemplates': 'Project Templates', + 'home.blankTemplateDesc': 'Create an empty workspace.', + 'home.remixDefaultTemplateDesc': 'Create a workspace with sample files.', + 'home.ozerc20TemplateDesc': 'Create an ERC20 token by importing OpenZeppelin library.', + 'home.ozerc721TemplateDesc': 'Create an NFT token by importing OpenZeppelin library.', + 'home.zeroxErc20TemplateDesc': 'Create an ERC20 token by importing 0xProject contract.', + 'home.learn': 'Learn', + 'home.remixBasics': 'Remix Basics', + 'home.remixBasicsDesc': "Introduction to Remix's interface and concepts used in Ethereum, as well as the basics of Solidity.", + 'home.remixIntermediate': 'Remix Intermediate', + 'home.remixIntermediateDesc': 'Using the web3.js to interact with a contract. Using Recorder tool.', + 'home.remixAdvanced': 'Remix Advanced', + 'home.remixAdvancedDesc': 'Learn the Proxy Pattern and working with Libraries in Remix. Learn to use the Debugger.', + 'home.remixYoutubePlaylist': 'Remix Youtube Playlist', + 'home.remixTwitterProfile': 'Remix Twitter Profile', + 'home.remixLinkedinProfile': 'Remix Linkedin Profile', + 'home.remixMediumPosts': 'Remix Medium Posts', + 'home.remixGitterChannel': 'Remix Gitter Channel', + 'home.nativeIDE': 'The Native IDE for Web3 Development.', + 'home.website': 'Website', + 'home.documentation': 'Documentation', + 'home.remixPlugin': 'Remix Plugin', + 'home.remixDesktop': 'Remix Desktop', + 'home.searchDocumentation': 'Search Documentation', 'home.files': 'Files', 'home.newFile': 'New File', 'home.openFile': 'Open File', diff --git a/apps/remix-ide/src/app/tabs/locales/zh-CN.js b/apps/remix-ide/src/app/tabs/locales/zh-CN.js index a69d823b0f..aa071c4b5f 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh-CN.js +++ b/apps/remix-ide/src/app/tabs/locales/zh-CN.js @@ -70,7 +70,47 @@ export default { 'home.scamAlertText3': '其他安全提示', 'home.learnMore': '了解更多', 'home.here': '这里', + 'home.more': '更多', + 'home.featured': '精选', + 'home.jumpIntoWeb3': '迎接 WEB3', + 'home.jumpIntoWeb3Text': 'Remix 项目是一个丰富的工具集,任何知识水平的用户都可以在这上面进行全周期的合约开发,并且可作为以太坊教学和实验的学习实验室。', + 'home.remixRewards': 'REMIX 奖励', + 'home.remixRewardsText1': '给我们的用户提供的 NFT!', + 'home.remixRewardsText2': 'Remix 会用部署在 Optimism 链上的 NFT 奖励贡献者、beta 测试者和用户体验研究参与者。Remix 奖励的持有者可以铸造第二个“Remixer”用户 NFT 徽章,以赠予他们选择的任何其他用户。', + 'home.betaTesting': 'BETA 测试', + 'home.betaTestingText1': '我们的社区支持我们', + 'home.betaTestingText2': '每次 Remix IDE 发布版本之前,你都可以参与 Beta 测试。现在就来帮我们测试并且尝鲜新功能吧!', 'home.featuredPlugins': '精选插件', + 'home.solidityPluginDesc': '编译、测试和分析智能合约。', + 'home.starkNetPluginDesc': '用 Cairo 来编译且部署合约,这是 StarkNet 的原生语言', + 'home.solhintPluginDesc': 'Solhint 是一个用于检查 Solidity 代码的开源项目', + 'home.sourcifyPluginDesc': 'Solidity 合约和元数据验证服务。', + 'home.unitTestPluginDesc': '在 Solidity 中为你的合约编写和运行单元测试。', + 'home.getStarted': '开始使用', + 'home.projectTemplates': '项目模板', + 'home.blankTemplateDesc': '创建一个空的工作空间。', + 'home.remixDefaultTemplateDesc': '创建一个带有样本文件的工作空间', + 'home.ozerc20TemplateDesc': '通过引入 OpenZeppelin 库来创建一个 ERC20 代币。', + 'home.ozerc721TemplateDesc': '通过引入 OpenZeppelin 库来创建一个 NFT 代币。', + 'home.zeroxErc20TemplateDesc': '通过引入 0xProject 合约来创建一个 ERC20 代币。', + 'home.learn': '学习', + 'home.remixBasics': 'Remix 基础', + 'home.remixBasicsDesc': "介绍 Remix 的界面和在以太坊中使用的概念,以及 Solidity 的基础知识。", + 'home.remixIntermediate': 'Remix 中级', + 'home.remixIntermediateDesc': '使用 web3.js 与合约交互。使用记录器工具。', + 'home.remixAdvanced': 'Remix 高级', + 'home.remixAdvancedDesc': '学习代理模式并使用 Remix 中的库。学习使用调试器。', + 'home.remixYoutubePlaylist': 'Remix Youtube 播放列表', + 'home.remixTwitterProfile': 'Remix 推特档案', + 'home.remixLinkedinProfile': 'Remix 领英档案', + 'home.remixMediumPosts': 'Remix Medium 文章', + 'home.remixGitterChannel': 'Remix Gitter 频道', + 'home.nativeIDE': '用于 Web3 开发的原生 IDE。', + 'home.website': '网站', + 'home.documentation': '文档', + 'home.remixPlugin': 'Remix 插件', + 'home.remixDesktop': 'Remix 桌面版', + 'home.searchDocumentation': '搜索文档', 'home.files': '文件', 'home.newFile': '新建文件', 'home.openFile': '打开本地文件', diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx index 54d94c8352..7cec849dd4 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import React, { useEffect, useState, useRef, useContext } from 'react' +import { FormattedMessage } from 'react-intl' import { ThemeContext, themes } from '../themeContext' import Carousel from 'react-multi-carousel' import 'react-multi-carousel/lib/styles.css' @@ -10,7 +11,7 @@ function HomeTabFeatured() { return (
- +
@@ -37,29 +38,37 @@ function HomeTabFeatured() {
-
JUMP INTO WEB3
-

The Remix Project is a rich toolset which can be used for the entire journey of contract development by users of any knowledge level, and as a learning lab for teaching and experimenting with Ethereum.

- _paq.push(['trackEvent', 'hometab', 'featuredSection', 'jumpIntoWeb3'])} target="__blank" href="https://remix-project.org">More +
+

+ +

+ _paq.push(['trackEvent', 'hometab', 'featuredSection', 'jumpIntoWeb3'])} target="__blank" href="https://remix-project.org">
-
REMIX REWARDS
-

NFTs for our users!

+
+

- Remix Project rewards contributors, beta testers, and UX research participants with NFTs deployed on Optimism. Remix Reward holders are able to mint a second “Remixer” user NFT badge to give to any other user of their choice. +

- _paq.push(['trackEvent', 'hometab', 'featuredSection', 'remixRewards'])} href="https://rewards.remix.ethereum.eth.limo">More + _paq.push(['trackEvent', 'hometab', 'featuredSection', 'remixRewards'])} href="https://rewards.remix.ethereum.eth.limo">
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx index 2638c85ff7..fee418f718 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import React, { useEffect, useRef, useContext } from 'react' -import { FormattedMessage } from 'react-intl' +import { FormattedMessage, useIntl } from 'react-intl' import PluginButton from './pluginButton' import { ThemeContext } from '../themeContext' import Carousel from 'react-multi-carousel' @@ -22,6 +22,7 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { const themeFilter = useContext(ThemeContext) const carouselRef = useRef({}) const carouselRefDiv = useRef(null) + const intl = useIntl() useEffect(() => { document.addEventListener("wheel", handleScroll) @@ -121,7 +122,7 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { imgPath="assets/img/solidityLogo.webp" envID="solidityLogo" envText="Solidity" - description="Compile, test and analyse smart contract." + description={intl.formatMessage({ id: 'home.solidityPluginDesc', defaultMessage: "Compile, test and analyse smart contract." })} remixMaintained={true} callback={() => startSolidity()} /> @@ -129,28 +130,28 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { imgPath="assets/img/starkNetLogo.webp" envID="starkNetLogo" envText="StarkNet" - description="Compile and deploy contracts with Cairo, a native language for StarkNet." + description={intl.formatMessage({ id: 'home.starkNetPluginDesc', defaultMessage: "Compile and deploy contracts with Cairo, a native language for StarkNet." })} l2={true} callback={() => startStarkNet()} /> startSolhint()} /> startSourceVerify()} /> startSolidityUnitTesting()} /> diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx index c9f29f6b22..7d8070525b 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -154,7 +154,7 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
- + { diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index aa65cf9dd7..a733c53498 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import React, { useEffect, useRef, useContext } from 'react' +import { useIntl, FormattedMessage } from 'react-intl' import { ThemeContext} from '../themeContext' import Carousel from 'react-multi-carousel' import WorkspaceTemplate from './workspaceTemplate' @@ -19,6 +20,7 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { const themeFilter = useContext(ThemeContext) const carouselRef = useRef({}) const carouselRefDiv = useRef(null) + const intl = useIntl() useEffect(() => { document.addEventListener("wheel", handleScroll) @@ -37,7 +39,7 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { } return false; } - + const handleScroll = (e) => { if (isDescendant(carouselRefDiv.current, e.target)) { e.stopPropagation() @@ -67,9 +69,9 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) {
@@ -84,7 +86,7 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { draggable={true} showDots={false} responsive={ - { + { superLargeDesktop: { breakpoint: { max: 4000, min: 3000 }, items: 5 @@ -106,27 +108,27 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { createWorkspace("blank")} /> createWorkspace("remixDefault")} /> createWorkspace("ozerc20")} /> createWorkspace("ozerc721")} /> createWorkspace("zeroxErc20")} /> diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx index e75fbdd014..bfad4b1967 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import React, { useEffect, useState, useContext } from 'react' +import { FormattedMessage } from 'react-intl' import { ThemeContext } from '../themeContext' declare global { interface Window { @@ -40,7 +41,9 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { return (
- +
@@ -75,4 +94,4 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { ) } -export default HomeTabLearn \ No newline at end of file +export default HomeTabLearn diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx index 0ca38dc338..790bb1ab70 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx @@ -3,6 +3,7 @@ import BasicLogo from 'libs/remix-ui/vertical-icons-panel/src/lib/components/BasicLogo' import { ThemeContext } from '../themeContext' import React, { useEffect, useState, useRef, useContext } from 'react' +import { FormattedMessage, useIntl } from 'react-intl' import { CustomTooltip } from '@remix-ui/helper' const _paq = window._paq = window._paq || [] // eslint-disable-line @@ -23,6 +24,7 @@ function HomeTabTitle() { const themeFilter = useContext(ThemeContext) const searchInputRef = useRef(null) const remiAudioEl = useRef(null) + const intl = useIntl() const playRemi = async () => { remiAudioEl.current.play() @@ -68,7 +70,7 @@ function HomeTabTitle() { placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" - tooltipText="Remix Youtube Playlist" + tooltipText={} tooltipTextClasses="border bg-light text-dark p-1 pr-3" >
- The Native IDE for Web3 Development. + + +
) @@ -76,7 +76,7 @@ export const TxBrowser = ({ requestDebug, updateTxNumberFlag, unloadRequested, t type='text' onChange={({ target: { value } }) => txInputChanged(value)} onInput={txInputOnInput} - placeholder={intl.formatMessage({id: 'debugger.placeholder', defaultMessage: 'Transaction hash, should start with 0x'})} + placeholder={intl.formatMessage({id: 'debugger.placeholder'})} data-id='debuggerTransactionInput' disabled={debugging} /> @@ -84,7 +84,7 @@ export const TxBrowser = ({ requestDebug, updateTxNumberFlag, unloadRequested, t
} + tooltipText={} tooltipId={'debuggingButtontooltip'} tooltipClasses="text-nowrap" > diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx index 7cec849dd4..77eee39230 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx @@ -11,7 +11,7 @@ function HomeTabFeatured() { return (
- +
@@ -38,37 +38,27 @@ function HomeTabFeatured() { diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx index fee418f718..9c535301ff 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx @@ -86,7 +86,7 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { return (
- +
startSolidity()} /> @@ -130,28 +130,28 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { imgPath="assets/img/starkNetLogo.webp" envID="starkNetLogo" envText="StarkNet" - description={intl.formatMessage({ id: 'home.starkNetPluginDesc', defaultMessage: "Compile and deploy contracts with Cairo, a native language for StarkNet." })} + description={intl.formatMessage({ id: 'home.starkNetPluginDesc' })} l2={true} callback={() => startStarkNet()} /> startSolhint()} /> startSourceVerify()} /> startSolidityUnitTesting()} /> diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx index 7d8070525b..50ec5bf8fa 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx @@ -154,16 +154,16 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
- - - + + + { event.stopPropagation() plugin.verticalIcons.select('filePanel') uploadFile(event.target) }} multiple /> - - + +
} diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx index b789a9b4f5..790a3bc843 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx @@ -7,26 +7,26 @@ const _paq = window._paq = window._paq || [] // eslint-disable-line function HomeTabScamAlert () { return (
- + diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx index 790bb1ab70..d360e5305f 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx @@ -70,7 +70,7 @@ function HomeTabTitle() { placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" - tooltipText={} + tooltipText={} tooltipTextClasses="border bg-light text-dark p-1 pr-3" >
- +
@@ -170,7 +170,7 @@ function HomeTabTitle() { type="text" className="border form-control border-right-0" id="homeTabSearchInput" - placeholder={intl.formatMessage({id: "home.searchDocumentation", defaultMessage: "Search Documentation" })} + placeholder={intl.formatMessage({ id: "home.searchDocumentation" })} data-id="terminalInputSearch" /> {children} diff --git a/libs/remix-ui/run-tab/src/lib/components/account.tsx b/libs/remix-ui/run-tab/src/lib/components/account.tsx index 6456827d49..46c611ce50 100644 --- a/libs/remix-ui/run-tab/src/lib/components/account.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/account.tsx @@ -82,7 +82,7 @@ export function AccountUI (props: AccountProps) { message='Enter your passphrase for this account to sign the message' setPassphrase={props.setPassphrase} />, 'OK', () => { - props.modal(intl.formatMessage({id: 'udapp.signAMessage', defaultMessage: 'Sign a message'}), signMessagePrompt(), 'OK', () => { + props.modal(intl.formatMessage({ id: 'udapp.signAMessage' }), signMessagePrompt(), 'OK', () => { props.signMessageWithAddress(selectedAccount, messageRef.current, signedMessagePrompt, props.passphrase) props.setPassphrase('') }, 'Cancel', null) @@ -91,7 +91,7 @@ export function AccountUI (props: AccountProps) { }) } - props.modal(intl.formatMessage({id: 'udapp.signAMessage', defaultMessage: 'Sign a message'}), signMessagePrompt(), 'OK', () => { + props.modal(intl.formatMessage({ id: 'udapp.signAMessage' }), signMessagePrompt(), 'OK', () => { props.signMessageWithAddress(selectedAccount, messageRef.current, signedMessagePrompt) }, 'Cancel', null) } @@ -123,7 +123,7 @@ export function AccountUI (props: AccountProps) { const signMessagePrompt = () => { return ( -
+