Skip to content

Commit c311014

Browse files
committed
update networks page with translations
1 parent 9113a28 commit c311014

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

app/[locale]/layer-2/networks/_components/networks.tsx

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ import MainArticle from "@/components/MainArticle"
77
import NetworkMaturity from "@/components/NetworkMaturity"
88
import { ButtonLink } from "@/components/ui/buttons/Button"
99

10+
import useTranslation from "@/hooks/useTranslation"
1011
import { usePathname } from "@/i18n/routing"
1112
import Callout2Image from "@/public/images/layer-2/layer-2-walking.png"
1213
import Callout1Image from "@/public/images/man-and-dog-playing.png"
1314

1415
const Layer2Networks = ({ layer2Data, locale, mainnetData }) => {
1516
const pathname = usePathname()
17+
const { t } = useTranslation(["page-layer-2-networks", "common"])
1618

1719
const heroProps: ContentHeroProps = {
1820
breadcrumbs: { slug: pathname, startDepth: 1 },
1921
heroImg: "/images/layer-2/learn-hero.png",
2022
blurDataURL: "/images/layer-2/learn-hero.png",
21-
title: "Explore networks",
22-
description:
23-
"Using Ethereum today means interacting with hundreds of different networks and apps. All backed by Ethereum as the foundational backbone.",
23+
title: t("common:nav-networks-explore-networks-label"),
24+
description: t("page-layer-2-networks-hero-description"),
2425
}
2526

2627
return (
@@ -35,23 +36,22 @@ const Layer2Networks = ({ layer2Data, locale, mainnetData }) => {
3536

3637
<div id="more-advanced-cta" className="w-full px-8 py-9">
3738
<div className="flex flex-col gap-8 bg-main-gradient px-12 py-14">
38-
<h3>Looking for more advanced overview?</h3>
39+
<h3>{t("page-layer-2-networks-more-advanced-title")}</h3>
3940
<div className="flex max-w-[768px] flex-col gap-8">
4041
<p>
41-
Many of the projects are{" "}
42-
<strong>still young and somewhat experimental.</strong>
43-
</p>
44-
<p>
45-
For more information on the technology, risks and trust
46-
assumptions of these networks, we recommend checking out L2BEAT,
47-
which provides a comprehensive risk assessment framework of each
48-
project and growthepie for general data analysis.
42+
{t("page-layer-2-networks-more-advanced-descripton-1")}{" "}
43+
<strong>
44+
{t("page-layer-2-networks-more-advanced-descripton-2")}
45+
</strong>
4946
</p>
47+
<p>{t("page-layer-2-networks-more-advanced-descripton-3")}</p>
5048
</div>
5149
<div className="flex flex-col gap-6 sm:flex-row">
52-
<ButtonLink href="https://l2beat.com">Visit l2beat.com</ButtonLink>
50+
<ButtonLink href="https://l2beat.com">
51+
{t("page-layer-2-networks-more-advanced-link-1")}
52+
</ButtonLink>
5353
<ButtonLink href="https://growthepie.xyz">
54-
Visit growthepie.xyz
54+
{t("page-layer-2-networks-more-advanced-link-2")}
5555
</ButtonLink>
5656
</div>
5757
</div>
@@ -65,10 +65,8 @@ const Layer2Networks = ({ layer2Data, locale, mainnetData }) => {
6565
>
6666
<Callout
6767
image={Callout1Image}
68-
title={"What are the benefits?"}
69-
description={
70-
"Ethereum's strength and security provides a platform for other networks to build upon."
71-
}
68+
title={t("page-layer-2-networks-callout-1-title")}
69+
description={t("page-layer-2-networks-callout-1-description")}
7270
>
7371
<div>
7472
<ButtonLink
@@ -79,16 +77,14 @@ const Layer2Networks = ({ layer2Data, locale, mainnetData }) => {
7977
eventName: "bottom_hub",
8078
}}
8179
>
82-
Learn more
80+
{t("common:learn-more")}
8381
</ButtonLink>
8482
</div>
8583
</Callout>
8684
<Callout
8785
image={Callout2Image}
88-
title={"Interested in more details?"}
89-
description={
90-
"Curious about the technology and reasons for this scaling approach? Learn more about the thinking and different technological approaches."
91-
}
86+
title={t("page-layer-2-networks-callout-2-title")}
87+
description={t("page-layer-2-networks-callout-2-description")}
9288
>
9389
<div>
9490
<ButtonLink
@@ -99,7 +95,7 @@ const Layer2Networks = ({ layer2Data, locale, mainnetData }) => {
9995
eventName: "bottom_learn",
10096
}}
10197
>
102-
Learn more
98+
{t("common:learn-more")}
10399
</ButtonLink>
104100
</div>
105101
</Callout>

app/[locale]/layer-2/networks/page.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pick from "lodash.pick"
2+
import { getTranslations } from "next-intl/dist/types/src/server/react-server"
23

34
import { Lang } from "@/lib/types"
45

@@ -128,12 +129,16 @@ export async function generateMetadata({
128129
}) {
129130
const { locale } = await params
130131

132+
const t = await getTranslations({
133+
locale,
134+
namespace: "page-layer-2-networks",
135+
})
136+
131137
return await getMetadata({
132138
locale,
133139
slug: ["layer-2", "networks"],
134-
title: "Ethereum Layer 2:Explore networks",
135-
description:
136-
"Using Ethereum today means interacting with hundreds of different networks and apps. All backed by Ethereum as the foundational backbone.",
140+
title: t("page-layer-2-networks-meta-title"),
141+
description: t("page-layer-2-networks-hero-description"),
137142
image: "/images/layer-2/learn-hero.png",
138143
})
139144
}

0 commit comments

Comments
 (0)