Skip to content

Commit 724c803

Browse files
authored
Merge pull request #2 from Turupawn/l2es-pr
Remaining updates from the dopped branch.
2 parents 43a0fe9 + b2fcb07 commit 724c803

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

public/locales/en/translation.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
{
2+
"rightSidebar": {
3+
"onThisPage": "On This Page",
4+
"more": "More",
5+
"editThisPage": "Edit this page",
6+
"joinOurCommunity": "Join our community",
7+
"feedback": "Feedback"
8+
},
9+
"ui": {
10+
"whatsNext": "What's Next"
11+
},
212
"landing": {
313
"test": "test",
414
"search": {

src/components/PageContent/WhatsNext.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2+
import i18next, { t } from "i18next"
23
export type Props = { content: Record<string, string> }
34
const { content = {} } = Astro.props as Props
45
---
56

67
<section>
7-
<h4>Whats Next</h4>
8+
<h4>{t("ui.whatsNext")}</h4>
89
<ul class="whats-next">
910
{
1011
Object.keys(content).map((key) => (

src/components/RightSidebar/MoreMenu.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2+
import i18next, { t } from "i18next"
23
import * as CONFIG from "../../config"
34
const { editHref } = Astro.props
45
const showMoreSection = CONFIG.COMMUNITY_INVITE_URL || editHref
56
---
67

7-
{showMoreSection && <h2 class="heading">More</h2>}
8+
{showMoreSection && <h2 class="heading">{t("rightSidebar.more")}</h2>}
89
<ul>
910
{
1011
editHref && (
@@ -27,7 +28,7 @@ const showMoreSection = CONFIG.COMMUNITY_INVITE_URL || editHref
2728
</clipPath>
2829
</defs>
2930
</svg>
30-
<span>Edit this page</span>
31+
<span>{t("rightSidebar.editThisPage")}</span>
3132
</a>
3233
</li>
3334
)
@@ -56,7 +57,7 @@ const showMoreSection = CONFIG.COMMUNITY_INVITE_URL || editHref
5657
fill="currentColor"
5758
/>
5859
</svg>
59-
<span>Join our community</span>
60+
<span>{t("rightSidebar.joinOurCommunity")}</span>
6061
</a>
6162
</li>
6263
)

src/components/RightSidebar/RightSidebar.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import i18next, { t } from "i18next"
23
import TableOfContents from "./TableOfContents"
34
import MoreMenu from "./MoreMenu.astro"
45
import { Feedback } from "../PageContent/Feedback"
@@ -15,7 +16,7 @@ const { content, githubEditUrl, headings, clientSideToc } = Astro.props
1516
</div>
1617

1718
<div>
18-
<h2 class="heading feedback-title">Feedback</h2>
19+
<h2 class="heading feedback-title">{t("rightSidebar.feedback")}</h2>
1920
<div class="feedback-wrapper">
2021
<Feedback client:idle />
2122
</div>

src/components/RightSidebar/TableOfContents/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { useStore } from "@nanostores/preact"
33
import type { FunctionalComponent } from "preact"
44
import { useState, useEffect, useRef } from "preact/hooks"
55
import { shouldUpdateToc } from "./tocStore"
6+
import i18next, { t } from "i18next"
7+
68
export interface Heading {
79
depth: number
810
text: string
@@ -79,7 +81,7 @@ const TableOfContents: FunctionalComponent<{
7981

8082
return (
8183
<>
82-
<h2 className="heading">On this page</h2>
84+
<h2 className="heading">{t("rightSidebar.onThisPage")}</h2>
8385
<ul ref={tableOfContents}>
8486
{headings
8587
.filter(({ depth }) => depth > 1 && depth < 4)

src/config/sidebar.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const getSidebar = () => {
6262
],
6363
developers: [
6464
{
65-
section: "Developers",
65+
section: t("sidebar.developers.developers"),
6666
contents: [
6767
{ title: t("sidebar.developers.buildingOnScroll"), url: formatUrl("developers") },
6868
{ title: t("sidebar.developers.developerQuickstart"), url: formatUrl("developers/developer-quickstart") },
@@ -125,7 +125,7 @@ export const getSidebar = () => {
125125
],
126126
},
127127
{
128-
section: "Guides",
128+
section: t("sidebar.developers.guides"),
129129
contents: [
130130
{
131131
title: t("sidebar.developers.contractDeploymentTutorial"),
@@ -154,7 +154,7 @@ export const getSidebar = () => {
154154
],
155155
},
156156
{
157-
section: "Resources",
157+
section: t("sidebar.developers.resources"),
158158
contents: [
159159
{ title: t("sidebar.developers.rollupExplorer"), url: "https://scroll.io/rollupscan" },
160160
{ title: t("sidebar.developers.scrollSepoliaBlockExplorer"), url: "https://sepolia-blockscout.scroll.io/" },
@@ -164,8 +164,8 @@ export const getSidebar = () => {
164164
],
165165
technology: [
166166
{
167-
section: "Overview",
168-
contents: [{ title: t("Scroll Architecture"), url: formatUrl("technology") }],
167+
section: t("sidebar.technology.overview"),
168+
contents: [{ title: t("sidebar.technology.scrollArchitecture"), url: formatUrl("technology") }],
169169
},
170170
{
171171
section: t("sidebar.technology.scrollChain"),

0 commit comments

Comments
 (0)