Skip to content

Commit 3283201

Browse files
committed
i18n: extract strings for translation
1 parent 32b3202 commit 3283201

File tree

3 files changed

+104
-105
lines changed

3 files changed

+104
-105
lines changed

app/[locale]/developers/page.tsx

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ const DevelopersPage = async ({
8383
<Section id="build" className="space-y-4 py-10 md:py-12">
8484
<h2>{t("page-developers-get-started")}</h2>
8585

86-
<p>
87-
Everything you need to learn and build your first apps on Ethereum
88-
</p>
86+
<p>{t("page-developers-build-section-desc")}</p>
8987
{/* Desktop */}
9088
<div className="grid gap-6 max-md:hidden md:grid-cols-2 lg:grid-cols-4">
9189
{paths.map((path, idx) => (
@@ -108,7 +106,9 @@ const DevelopersPage = async ({
108106
"-mx-8 w-screen max-w-screen-2xl bg-background-highlight px-8 py-10 md:py-20"
109107
)}
110108
>
111-
<h2 className="sr-only">Helpful developer resources</h2>
109+
<h2 className="sr-only">
110+
{t("page-developers-resources-section-title")}
111+
</h2>
112112

113113
{/* Quickstart your idea */}
114114
<Card className="!space-y-8 break-words border bg-background px-6 py-8 md:space-y-6 lg:p-8">
@@ -165,10 +165,9 @@ const DevelopersPage = async ({
165165
className="max-h-56 w-full object-cover object-top"
166166
/>
167167
<div className="">
168-
<h3>Get help</h3>
168+
<h3>{t("page-developers-get-help-title")}</h3>
169169
<p className="text-sm text-body-medium">
170-
If you are stuck or need help solving problems, be sure to ask
171-
for guidance.
170+
{t("page-developers-get-help-desc")}
172171
</p>
173172
</div>
174173

@@ -178,14 +177,14 @@ const DevelopersPage = async ({
178177
isSecondary
179178
href="https://ethereum.stackexchange.com/"
180179
>
181-
Stack Exchange
180+
{t("page-developers-stack-exchange")}
182181
</ButtonLink>
183182
<ButtonLink
184183
variant="ghost"
185184
isSecondary
186185
href="#some-magical-AI-link"
187186
>
188-
Ask AI
187+
{t("page-developers-ask-ai")}
189188
</ButtonLink>
190189
</div>
191190
</Card>
@@ -199,10 +198,9 @@ const DevelopersPage = async ({
199198
className="max-h-56 w-full object-contain"
200199
/>
201200
<div className="">
202-
<h3>Resources</h3>
201+
<h3>{t("page-developers-resources-title")}</h3>
203202
<p className="text-sm text-body-medium">
204-
Want to experiment first, ask questions later? Check sandboxes,
205-
bootcamps etc.
203+
{t("page-developers-resources-desc")}
206204
</p>
207205
</div>
208206

@@ -212,7 +210,7 @@ const DevelopersPage = async ({
212210
isSecondary
213211
href="/developers/learning-tools/"
214212
>
215-
Play with code
213+
{t("page-developers-play-code")}
216214
</ButtonLink>
217215
</div>
218216
</Card>
@@ -226,10 +224,9 @@ const DevelopersPage = async ({
226224
className="max-h-56 w-full object-contain"
227225
/>
228226
<div className="">
229-
<h3>Tutorials</h3>
227+
<h3>{t("page-developers-tutorials-title")}</h3>
230228
<p className="text-sm text-body-medium">
231-
Learn Ethereum development step-by-step from builders who have
232-
already done it.
229+
{t("page-developers-tutorials-desc")}
233230
</p>
234231
</div>
235232

@@ -239,18 +236,15 @@ const DevelopersPage = async ({
239236
isSecondary
240237
href="/developers/tutorials/"
241238
>
242-
View tutorials
239+
{t("page-developers-learn-tutorials-cta")}
243240
</ButtonLink>
244241
</div>
245242
</Card>
246243
</Section>
247244

248245
<Section id="courses" className="space-y-4 py-10 md:py-12">
249-
<h2>Video courses</h2>
250-
<p>
251-
Want to kickstart your professional career in blockchain? These
252-
courses will prepare you to get hired as blockchain developer.
253-
</p>
246+
<h2>{t("page-developers-video-courses-title")}</h2>
247+
<p>{t("page-developers-video-courses-desc")}</p>
254248

255249
<div className="w-screen max-xl:-ms-8 xl:w-full">
256250
<VideoCourseSwiper courses={courses} />
@@ -266,7 +260,7 @@ const DevelopersPage = async ({
266260
>
267261
<div className="w-full scroll-mt-24 px-8 py-4">
268262
<h2>{t("page-developers-explore-documentation")}</h2>
269-
<p>Understand the core concepts of Ethereum and blockchains</p>
263+
<p>{t("page-developers-docs-section-desc")}</p>
270264
</div>
271265

272266
<div className="flex flex-col items-start justify-between px-8 py-0 lg:flex-row">
@@ -383,15 +377,12 @@ const DevelopersPage = async ({
383377
</Section>
384378

385379
<Section id="hackathons" className="space-y-4 py-10 md:py-12">
386-
<h2>Join hackathons (TODO)</h2>
387-
<p>
388-
Hackathons are great opportunities to network and learn from others
389-
as well as start projects and earn prizes
390-
</p>
380+
<h2>{t("page-developers-hackathons-title")}</h2>
381+
<p>{t("page-developers-hackathons-desc")}</p>
391382
<SkeletonCardGrid />
392383
<div className="flex justify-center">
393384
<ButtonLink href="https://ethglobal.com/">
394-
Visit EthGlobal
385+
{t("page-developers-visit-ethglobal")}
395386
</ButtonLink>
396387
</div>
397388
</Section>
@@ -407,23 +398,19 @@ const DevelopersPage = async ({
407398
>
408399
<div className="mb-12 flex flex-col items-center gap-y-8 rounded-4xl bg-radial-a px-8 py-12 lg:mb-32 xl:mb-36">
409400
<div className="flex flex-col gap-y-4 text-center">
410-
<h2>Are you a founder?</h2>
411-
<p>
412-
Have a project idea already or working on a prototype? Explore
413-
how to take your project to the next step. Many other
414-
organizations that provide developers with funding.
415-
</p>
401+
<h2>{t("page-developers-founders-title")}</h2>
402+
<p>{t("page-developers-founders-desc")}</p>
416403
</div>
417404
<div className="flex flex-wrap gap-4">
418405
<ButtonLink href="mailto:[email protected]?subject=Founder%20inquiry">
419-
Get in touch
406+
{t("page-developers-get-in-touch")}
420407
</ButtonLink>
421408
<ButtonLink
422409
href="/community/grants/"
423410
isSecondary
424411
variant="outline"
425412
>
426-
See grant options
413+
{t("page-developers-see-grant-options")}
427414
</ButtonLink>
428415
</div>
429416
</div>

app/[locale]/developers/utils.ts

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,90 +21,81 @@ export const getBuilderPaths = async (): Promise<DevelopersPath[]> => {
2121
return [
2222
{
2323
imgSrc: speedrunNFT,
24-
imgAlt: "Speedrun Ethereum NFT banner",
25-
title: "Simple NFT Example", // t("page-developers-learn"),
26-
description: "Create a public NFT to learn the basics of scaffold-eth.", // t("page-developers-learn-desc"),
24+
imgAlt: t("page-developers-speedrun-nft-alt"),
25+
title: t("page-developers-speedrun-nft-title"),
26+
description: t("page-developers-speedrun-nft-desc"),
2727
href: "https://speedrunethereum.com/challenge/simple-nft-example",
2828
button: t("page-developers-start-quest"),
29-
tag: "Challenge #0",
29+
tag: t("page-developers-speedrun-challenge-0"),
3030
},
3131
{
3232
imgSrc: speedrunStakingApp,
33-
imgAlt: "Speedrun Ethereum staking app banner",
34-
title: "Staking App", // t("page-developers-learn-tutorials"),
35-
description: "Write a smart contract where users pool funds together.", // t("page-developers-learn-tutorials-desc"),
33+
imgAlt: t("page-developers-speedrun-staking-alt"),
34+
title: t("page-developers-speedrun-staking-title"),
35+
description: t("page-developers-speedrun-staking-desc"),
3636
href: "https://speedrunethereum.com/challenge/decentralized-staking",
3737
button: t("page-developers-start-quest"),
38-
tag: "Challenge #1",
38+
tag: t("page-developers-speedrun-challenge-1"),
3939
},
4040
{
4141
imgSrc: speedrunTokenVendor,
42-
imgAlt: "Speedrun Ethereum token vendor project banner",
43-
title: "Create a token", // t("page-developers-resources"),
44-
description:
45-
"Build a digital currency and a smart conract that trades it.", // t("page-developers-start-desc"),
42+
imgAlt: t("page-developers-speedrun-token-alt"),
43+
title: t("page-developers-speedrun-token-title"),
44+
description: t("page-developers-speedrun-token-desc"),
4645
href: "https://speedrunethereum.com/challenge/token-vendor",
4746
button: t("page-developers-start-quest"),
48-
tag: "Challenge #2",
47+
tag: t("page-developers-speedrun-challenge-2"),
4948
},
5049
]
5150
}
5251

5352
export const getVideoCourses = async (): Promise<VideoCourse[]> => {
54-
// const locale = await getLocale()
55-
// const t = await getTranslations({
56-
// locale,
57-
// namespace: "page-developers-index",
58-
// })
53+
const locale = await getLocale()
54+
const t = await getTranslations({
55+
locale,
56+
namespace: "page-developers-index",
57+
})
5958

6059
return [
6160
{
62-
title: "Blockchain basics",
63-
description:
64-
"Learn how blockchains and smart contracts work, create a wallet, and sign your first transaction.",
61+
title: t("page-developers-course-blockchain-basics-title"),
62+
description: t("page-developers-course-blockchain-basics-desc"),
6563
hours: 3,
6664
imgSrc: cyfrinBasicBanner,
67-
imgAlt: "Cyfrin Updraft Blockchain basics course banner",
65+
imgAlt: t("page-developers-course-blockchain-basics-alt"),
6866
href: "https://updraft.cyfrin.io/courses/blockchain-basics",
6967
},
7068
{
71-
title: "Solidity smart contract development",
72-
description:
73-
"Solidity Programming is your gateway to web3 development in Ethereum compatible ecosystems.",
69+
title: t("page-developers-course-solidity-title"),
70+
description: t("page-developers-course-solidity-desc"),
7471
hours: 5,
7572
imgSrc: cyfrinSolidityBanner,
76-
imgAlt:
77-
"Cyfrin Updraft Solidity smart contract development course banner",
73+
imgAlt: t("page-developers-course-solidity-alt"),
7874
href: "https://updraft.cyfrin.io/courses/solidity",
7975
},
8076
{
81-
title: "Foundry fundamentals",
82-
description:
83-
"Level up your Solidity development skills with Foundry and advanced web3 development concepts and tools.",
77+
title: t("page-developers-course-foundry-fundamentals-title"),
78+
description: t("page-developers-course-foundry-fundamentals-desc"),
8479
hours: 10,
8580
imgSrc: cyfrinFoundryFundamentalsBanner,
86-
imgAlt: "Cyfrin Updraft Foundry fundamentals course banner",
81+
imgAlt: t("page-developers-course-foundry-fundamentals-alt"),
8782
href: "https://updraft.cyfrin.io/courses/foundry",
8883
},
8984
{
90-
title: "Advanced foundry",
91-
description:
92-
"Master web3 development techniques with Advanced Foundry for Solidity smart contract development.",
85+
title: t("page-developers-course-advanced-foundry-title"),
86+
description: t("page-developers-course-advanced-foundry-desc"),
9387
hours: 13,
9488
imgSrc: cyfrinFoundryAdvancedBanner,
95-
imgAlt: "Cyfrin Updraft Advanced foundry course banner",
89+
imgAlt: t("page-developers-course-advanced-foundry-alt"),
9690
href: "https://updraft.cyfrin.io/courses/advanced-foundry",
9791
},
9892
{
99-
title: "Smart contract security", // "Learn smart contract auditing, security, and DeFi",
100-
description:
101-
"Start your career as a smart contract security researcher! Learn smart contract auditing and the best practices.",
93+
title: t("page-developers-course-security-title"),
94+
description: t("page-developers-course-security-desc"),
10295
hours: 24,
10396
imgSrc: cyfrinSecurityBanner,
104-
imgAlt: "Cyfrin Updraft Blockchain basics course banner",
97+
imgAlt: t("page-developers-course-security-alt"),
10598
href: "https://updraft.cyfrin.io/courses/security",
10699
},
107100
]
108-
109-
return []
110101
}

0 commit comments

Comments
 (0)