From 93af8195a577d79856464828651ccf92f361b9e4 Mon Sep 17 00:00:00 2001 From: alexcss Date: Tue, 10 Dec 2024 18:25:19 +0200 Subject: [PATCH] Add translation support to Homae page strings --- i18n/en/code.json | 171 ++++++++++++++++++ .../HomepageSectionCommunity/index.js | 29 ++- .../Homepage/HomepageSectionDevTools/index.js | 41 ++--- .../Homepage/HomepageSectionGuides/index.js | 44 ++--- .../Homepage/HomepageSectionProducts/index.js | 48 ++--- src/components/ShareButtons/index.js | 12 +- 6 files changed, 242 insertions(+), 103 deletions(-) diff --git a/i18n/en/code.json b/i18n/en/code.json index 05e69905..88bb3bde 100644 --- a/i18n/en/code.json +++ b/i18n/en/code.json @@ -11,6 +11,177 @@ "Explore Docs": { "message": "Explore Docs" }, + "Guides for Builders": { + "message": "Guides for Builders" + }, + "Beginner to Web3?": { + "message": "Beginner to Web3?" + }, + "Explore Rootstock Fundamentals and resources to begin your development journey.": { + "message": "Explore Rootstock Fundamentals and resources to begin your development journey." + }, + "Core Concepts": { + "message": "Core Concepts" + }, + "Become a Rootstock Blockchain Developer": { + "message": "Become a Rootstock Blockchain Developer" + }, + "Deploy Smart Contracts": { + "message": "Deploy Smart Contracts" + }, + "EVM-compatible tools and guides to deploy and scale your dApps on Rootstock.": { + "message": "EVM-compatible tools and guides to deploy and scale your dApps on Rootstock." + }, + "Quick Starts": { + "message": "Quick Starts" + }, + "Join the Discord Community": { + "message": "Join the Discord Community" + }, + "Become a Merged Miner": { + "message": "Become a Merged Miner" + }, + "Interested in merged mining on Rootstock? Setup a Rootstock node or use the RPC API.": { + "message": "Interested in merged mining on Rootstock? Setup a Rootstock node or use the RPC API." + }, + "Merged Mining": { + "message": "Merged Mining" + }, + "RPC API": { + "message": "RPC API" + }, + "Apply for a Grant": { + "message": "Apply for a Grant" + }, + "Get funding and support to build your next dApp on Rootstock through the strategic grants program.": { + "message": "Get funding and support to build your next dApp on Rootstock through the strategic grants program." + }, + "Apply now": { + "message": "Apply now" + }, + "Browse by DevTools": { + "message": "Browse by DevTools" + }, + "Get RBTC": { + "message": "Get RBTC" + }, + "Explore the various ways to get RBTC using the PowPeg App, On/Off Ramps, or Exchanges.": { + "message": "Explore the various ways to get RBTC using the PowPeg App, On/Off Ramps, or Exchanges." + }, + "Quick Starts": { + "message": "Quick Starts" + }, + "View a repository of starter kits, sample codes and tutorials for creating, testing and deploying smart contracts on Rootstock.": { + "message": "View a repository of starter kits, sample codes and tutorials for creating, testing and deploying smart contracts on Rootstock." + }, + "EVM-compatible Tools": { + "message": "EVM-compatible Tools" + }, + "Build and deploy faster with EVM-compatible tools and guides on Rootstock.": { + "message": "Build and deploy faster with EVM-compatible tools and guides on Rootstock." + }, + "SDKs and Integration Guides": { + "message": "SDKs and Integration Guides" + }, + "Get up to speed, using easy-to-set-up SDKs and Integration Guides.": { + "message": "Get up to speed, using easy-to-set-up SDKs and Integration Guides." + }, + "Read more": { + "message": "Read more" + }, + "Browse by Products": { + "message": "Browse by Products" + }, + "Bridges": { + "message": "Bridges" + }, + "Bridge in/out of Rootstock.": { + "message": "Bridge in/out of Rootstock." + }, + "RBTC Flyover": { + "message": "RBTC Flyover" + }, + "PowPeg App": { + "message": "PowPeg App" + }, + "Token Bridge": { + "message": "Token Bridge" + }, + "Wallets": { + "message": "Wallets" + }, + "View wallets compatible with the Rootstock platform.": { + "message": "View wallets compatible with the Rootstock platform." + }, + "MetaMask": { + "message": "MetaMask" + }, + "Wallets on Rootstock": { + "message": "Wallets on Rootstock" + }, + "RIF Tools": { + "message": "RIF Tools" + }, + "Explore Open-source tools and technologies for faster, and more rewarding ways to build on Bitcoin.": { + "message": "Explore Open-source tools and technologies for faster, and more rewarding ways to build on Bitcoin." + }, + "Name Service": { + "message": "Name Service" + }, + "Relay": { + "message": "Relay" + }, + "Read": { + "message": "Read" + }, + "RPC API": { + "message": "RPC API" + }, + "Deploy and interact with EVM compatible smart contracts on Rootstock using JSON RPC methods using the Rootstock RPC API.": { + "message": "Deploy and interact with EVM compatible smart contracts on Rootstock using JSON RPC methods using the Rootstock RPC API." + }, + "Make First API Call": { + "message": "Make First API Call" + }, + "View JSON RPC Methods": { + "message": "View JSON RPC Methods" + }, + "Connect with the Community": { + "message": "Connect with the Community" + }, + "Join the Rootstock \n Developer Community on Discord.": { + "message": "Join the Rootstock \n Developer Community on Discord." + }, + "Join Discord": { + "message": "Join Discord" + }, + "Explore open source tools, smart contracts and starter kits for deploying and integrating your dApps.": { + "message": "Explore open source tools, smart contracts and starter kits for deploying and integrating your dApps." + }, + "Star on Github": { + "message": "Star on Github" + }, + "Stay Connected": { + "message": "Stay Connected" + }, + "View upcoming events, community calls, webinars, and meetups happening \n around the world.": { + "message": "View upcoming events, community calls, webinars, and meetups happening \n around the world." + }, + "View upcoming Events": { + "message": "View upcoming Events" + }, + "Read": { + "message": "Read" + }, + "theme.common.copyPageLinkMsg": { + "message": "Copied!" + }, + "theme.common.copyPageLink": { + "message": "Copy page link" + }, + "theme.common.backToTop": { + "message": "Back to top" + }, "theme.common.all": { "message": "All" }, diff --git a/src/components/Homepage/HomepageSectionCommunity/index.js b/src/components/Homepage/HomepageSectionCommunity/index.js index 2ff03902..107bfc86 100644 --- a/src/components/Homepage/HomepageSectionCommunity/index.js +++ b/src/components/Homepage/HomepageSectionCommunity/index.js @@ -1,54 +1,47 @@ -import clsx from 'clsx'; - import Card from "/src/components/Card"; +import Translate from "@docusaurus/core/lib/client/exports/Translate"; const data = { - title: 'Connect with the Community', + title: Connect with the Community', description: null, cards: [ { - title: 'Discord', + title: Discord, color: 'cyan', icon: 'discord', link: { - title: 'Join Discord', + title: Join Discord, href: 'https://discord.com/invite/rootstock', target: '_blank', }, description: ( - <> - Join the Rootstock
Developer Community on Discord. - + <>Join the Rootstock
Developer Community on Discord. ), }, { - title: 'GitHub', + title: GitHub, color: 'contrast', icon: 'github', link: { - title: 'Star on Github', + title: Star on Github, href: 'https://github.com/rsksmart/devportal', target: '_blank', }, description: ( - <> - Explore open source tools, smart contracts and starter kits for deploying and integrating your dApps. - + Explore open source tools, smart contracts and starter kits for deploying and integrating your dApps. ), }, { - title: 'Stay Connected', + title: Stay Connected, color: 'yellow', link: { - title: 'View upcoming Events', + title: View upcoming Events, href: 'https://rootstock.io/events', target: '_blank', }, description: ( - <> - View upcoming events, community calls,
webinars, and meetups happening
around the world. - + <>View upcoming events, community calls,
webinars, and meetups happening
around the world. ), }, ] diff --git a/src/components/Homepage/HomepageSectionDevTools/index.js b/src/components/Homepage/HomepageSectionDevTools/index.js index b98dceb6..0c83652c 100644 --- a/src/components/Homepage/HomepageSectionDevTools/index.js +++ b/src/components/Homepage/HomepageSectionDevTools/index.js @@ -1,68 +1,55 @@ -import clsx from 'clsx'; - import Card from "/src/components/Card"; +import Translate from "@docusaurus/core/lib/client/exports/Translate"; const data = { - title: 'Browse by DevTools', + title: Browse by DevTools, description: null, cards: [ { - title: 'Get RBTC', + title: Get RBTC, color: 'orange', link: { - title: 'Read more', + title: Read more, href: 'https://rootstock.io/rbtc/', }, description: ( - <> - Explore the various ways to get RBTC using the PowPeg App, On/Off Ramps, or Exchanges. - + Explore the various ways to get RBTC using the PowPeg App, On/Off Ramps, or Exchanges. ), }, { - title: 'Quick Starts', + title: Quick Starts, color: 'yellow', link: { - title: 'Read more', + title: Read more, href: '/developers/quickstart/', }, description: ( - <> - View a repository of starter kits, - sample codes and tutorials for creating, - testing and deploying smart contracts on Rootstock. - + View a repository of starter kits, sample codes and tutorials for creating, testing and deploying smart contracts on Rootstock. ), }, { title: ( - <> - EVM-compatible
Tools - + <>EVM-compatible
Tools ), color: 'cyan', link: { - title: 'Read more', + title: Read more, href: '/dev-tools/', }, description: ( - <> - Build and deploy faster with EVM-compatible tools and guides on Rootstock. - + Build and deploy faster with EVM-compatible tools and guides on Rootstock. ), }, { - title: 'SDKs and Integration Guides', + title: SDKs and Integration Guides, color: 'pink', link: { - title: 'Read more', + title: Read more, href: '/developers/integrate/', }, description: ( - <> - Get up to speed, using easy-to-set-up SDKs and Integration Guides. - + Get up to speed, using easy-to-set-up SDKs and Integration Guides. ), } ] diff --git a/src/components/Homepage/HomepageSectionGuides/index.js b/src/components/Homepage/HomepageSectionGuides/index.js index 00513913..382d516b 100644 --- a/src/components/Homepage/HomepageSectionGuides/index.js +++ b/src/components/Homepage/HomepageSectionGuides/index.js @@ -1,81 +1,71 @@ -import clsx from 'clsx'; - import Card from "/src/components/Card"; +import Translate from "@docusaurus/core/lib/client/exports/Translate"; const data = { - title: 'Guides for Builders', + title: Guides for Builders, description: null, cards: [ { - title: 'Beginner to Web3?', + title: Beginner to Web3?, color: 'orange', description: ( - <> - Explore Rootstock Fundamentals and resources to begin your development journey. - + Explore Rootstock Fundamentals and resources to begin your development journey. ), list: [ { - title: 'Core Concepts', + title: Core Concepts, href: '/concepts/fundamentals/', }, { - title: 'Become a Rootstock Blockchain Developer', + title: Become a Rootstock Blockchain Developer, href: '/resources/courses/', }, ], }, { - title: 'Deploy Smart Contracts', + title: Deploy Smart Contracts, color: 'purple', description: ( - <> - EVM-compatible tools and guides to deploy and scale your dApps on Rootstock. - + EVM-compatible tools and guides to deploy and scale your dApps on Rootstock. ), list: [ { - title: 'Quick Starts', + title: Quick Starts, href: '/developers/quickstart/', }, { - title: 'Join the Discord Community', + title: Join the Discord Community, href: 'http://discord.gg/rootstock', }, ], }, { - title: 'Become a Merged Miner', + title: Become a Merged Miner, color: 'green', description: ( - <> - Interested in merged mining on Rootstock? - Setup a Rootstock node or use the RPC API. - + Interested in merged mining on Rootstock? Setup a Rootstock node or use the RPC API. ), list: [ { - title: 'Merged Mining', + title: Merged Mining, href: '/node-operators/merged-mining/getting-started/', }, { - title: 'RPC API', + title: RPC API, href: 'https://rpc.rootstock.io/', }, ], }, { - title: 'Apply for a Grant', + title: Apply for a Grant, color: 'pink', description: ( - <> - Get funding and support to build your next dApp on Rootstock through the strategic grants program. - + Get funding and support to build your next dApp on Rootstock through the strategic grants program. ), list: [ { - title: 'Apply now', + title: Apply now, href: 'https://rootstock.io/grants/', }, ], diff --git a/src/components/Homepage/HomepageSectionProducts/index.js b/src/components/Homepage/HomepageSectionProducts/index.js index 41894896..f6179d07 100644 --- a/src/components/Homepage/HomepageSectionProducts/index.js +++ b/src/components/Homepage/HomepageSectionProducts/index.js @@ -1,91 +1,81 @@ import Card from "/src/components/Card"; +import Translate from "@docusaurus/core/lib/client/exports/Translate"; const data = { - title: 'Browse by Products', + title: Browse by Products, description: null, cards: [ { - title: 'Bridges', + title: Bridges, color: 'orange', description: ( - <> - Bridge in/out of Rootstock. - + Bridge in/out of Rootstock. ), list: [ { - title: 'RBTC Flyover', + title: RBTC Flyover, href: '/developers/integrate/flyover/', }, { - title: 'PowPeg App', + title: PowPeg App, href: 'https://powpeg.rootstock.io', }, { - title: 'Token Bridge', + title: Token Bridge, href: 'https://dapp.tokenbridge.rootstock.io', }, ], }, { - title: 'Wallets', + title: Wallets, color: 'green', description: ( - <> - View wallets compatible with the Rootstock platform. - + View wallets compatible with the Rootstock platform. ), list: [ { - title: 'MetaMask', + title: MetaMask, href: '/dev-tools/wallets/metamask', }, { - title: 'Wallets on Rootstock', + title: Wallets on Rootstock, href: '/dev-tools/wallets/', } ], }, { title: ( - <> - RIF Tools - + RIF Tools ), color: 'pink', description: ( - <> - Explore Open-source tools and technologies for faster, - and more rewarding ways to build on Bitcoin. - + Explore Open-source tools and technologies for faster, and more rewarding ways to build on Bitcoin. ), list: [ { - title: 'Name Service', + title: Name Service, href: 'https://rns.rifos.org/', }, { - title: 'Relay', + title: Relay, href: '/developers/integrate/rif-relay', }, ], }, { - title: 'RPC API', + title: RPC API, color: 'yellow', description: ( - <> - Deploy and interact with EVM compatible smart contracts on Rootstock using JSON RPC methods using the Rootstock RPC API. - + Deploy and interact with EVM compatible smart contracts on Rootstock using JSON RPC methods using the Rootstock RPC API. ), list: [ { - title: 'Make First API Call', + title: Make First API Call, href: '/developers/rpc-api/rootstock/setup/', }, { - title: 'View JSON RPC Methods', + title: View JSON RPC Methods, href: '/developers/rpc-api/rootstock/methods/', } ], diff --git a/src/components/ShareButtons/index.js b/src/components/ShareButtons/index.js index f755c754..2b94fb25 100644 --- a/src/components/ShareButtons/index.js +++ b/src/components/ShareButtons/index.js @@ -1,6 +1,7 @@ import React, {useState, useEffect} from "react"; import Button from "../Button"; import clsx from "clsx"; +import Translate from '@docusaurus/Translate'; export const ShareButtons = ({className}) => { const [showTip, setShowTip] = useState(false); @@ -77,8 +78,15 @@ export const ShareButtons = ({className}) => { copyLink(e); }} > - Copy page link - {showTip && (Copied!)} + + Copy page link + + {showTip && ( + + Copied! + + )} )