Skip to content

Commit 4295f6b

Browse files
authored
Merge pull request #2663 from tequdev/ja-codesamples-dev-tools
[JA] translate code-samples, dev-tools pages
2 parents c0c8ffa + bc94ecc commit 4295f6b

14 files changed

+287
-101
lines changed

@i18n/ja/translations.yaml

Lines changed: 198 additions & 41 deletions
Large diffs are not rendered by default.

resources/code-samples.page.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,31 +89,36 @@ export default function CodeSamples() {
8989
<div className="row pl-4">
9090
<div className=" col-lg-3 pl-4 pl-lg-0 pr-4 contribute dot contribute_1">
9191
<span className="dot" />
92-
<h5 className="pb-4 pt-md-5">Fork and clone</h5>
92+
<h5 className="pb-4 pt-md-5">{translate('Fork and clone')}</h5>
9393
<p className="pb-4">
94-
Fork the <a href="https://github.com/XRPLF/xrpl-dev-portal">xrpl-dev-portal repo</a>. Using git, clone
95-
the fork to your computer.
94+
{translate('resources.contribute.1.part1', 'Fork the ')}
95+
<a href="https://github.com/XRPLF/xrpl-dev-portal">
96+
{translate('resources.contribute.1.part2', 'xrpl-dev-portal repo')}
97+
</a>
98+
{translate('resources.contribute.1.part3', '. Using git, clone the fork to your computer.')}
9699
</p>
97100
</div>
98101
<div className=" col-lg-3 pl-4 pl-lg-0 pr-4 contribute dot contribute_2">
99102
<span className="dot" />
100-
<h5 className="pb-4 pt-md-5">Add to folder</h5>
103+
<h5 className="pb-4 pt-md-5">{translate('Add to folder')}</h5>
101104
<p className="pb-4">
102-
Add your sample code to the <code>content/_code-samples/</code> folder. Be sure to include a{' '}
103-
<code>README.md</code> that summarizes what it does and anything else people should know about it.
105+
{translate('resources.contribute.2.part1', 'Add your sample code to the ')}
106+
<code>content/_code-samples/</code>
107+
{translate('resources.contribute.2.part2', ' folder. Be sure to include a ')}
108+
<code>README.md</code>
109+
{translate('resources.contribute.2.part3', 'that summarizes what it does and anything else people should know about it.')}
104110
</p>
105111
</div>
106112
<div className=" col-lg-3 pl-4 pl-lg-0 pr-4 contribute dot contribute_3">
107113
<span className="dot" />
108-
<h5 className="pb-4 pt-md-5">Commit and push</h5>
109-
<p className="pb-4">Commit your changes and push them to your fork on GitHub.</p>
114+
<h5 className="pb-4 pt-md-5">{translate('Commit and push')}</h5>
115+
<p className="pb-4">{translate('resources.contribute.3.part1', 'Commit your changes and push them to your fork on GitHub.')}</p>
110116
</div>
111117
<div className=" col-lg-3 pl-4 pl-lg-0 pr-2 contribute dot contribute_4 mb-4">
112118
<span className="dot" />
113-
<h5 className="pb-4 pt-md-5">Open a pull request</h5>
119+
<h5 className="pb-4 pt-md-5">{translate('Open a pull request')}</h5>
114120
<p className="pb-0 mb-0">
115-
Open a pull request to the original repo. Maintainers will review your submission and suggest changes
116-
if necessary. If the code sample is helpful, it'll be merged and added to XRPL.org!
121+
{translate('resources.contribute.4.part1', "Open a pull request to the original repo. Maintainers will review your submission and suggest changes if necessary. If the code sample is helpful, it'll be merged and added to XRPL.org!")}
117122
</p>
118123
</div>
119124
</div>

resources/dev-tools/components/websocket-api/curl-modal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export const CurlModal: React.FC<CurlProps> = ({
5454
<form>
5555
<div className="form-group">
5656
<label htmlFor="curl-box-1">
57-
Use the following syntax to make the equivalent JSON-RPC
58-
request using <a href="https://curl.se/">cURL</a> from a
59-
commandline interface:
57+
{translate('resources.dev-tools.websocket-api.curl.modal.desc.part1', 'Use the following syntax to make the equivalent JSON-RPC request using ')}
58+
<a href="https://curl.se/">cURL</a>
59+
{translate('resources.dev-tools.websocket-api.curl.modal.desc.part2',' from a commandline interface:')}
6060
</label>
6161
<textarea
6262
id="curl-box-1"
@@ -74,13 +74,15 @@ export const CurlModal: React.FC<CurlProps> = ({
7474

7575
export const CurlButton = ({selectedConnection, currentBody}: CurlButtonProps) => {
7676
const [showCurlModal, setShowCurlModal] = useState(false);
77+
const { useTranslate } = useThemeHooks();
78+
const { translate } = useTranslate();
7779

7880
return <>
7981
<button
8082
className="btn btn-outline-secondary curl"
8183
data-toggle="modal"
8284
data-target="#wstool-1-curl"
83-
title="cURL syntax"
85+
title={translate("cURL Syntax")}
8486
onClick={() => setShowCurlModal(true)}
8587
>
8688
<i className="fa fa-terminal"></i>

resources/dev-tools/components/websocket-api/data/command-list.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@
554554
"name": "ledger_entry - AMM",
555555
"description": "Returns a single Automated Market Maker object in its raw ledger format.",
556556
"link": "/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry#get-amm-object",
557-
"status": "not_enabled",
558557
"body": {
559558
"id": "example_get_amm",
560559
"command": "ledger_entry",

resources/dev-tools/components/websocket-api/permalink-modal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ export const PermalinkButton = ({currentBody, selectedConnection}: PermaLinkButt
6262
const closePermalinkModal = () => {
6363
setIsPermalinkModalVisible(false);
6464
};
65+
const { useTranslate } = useThemeHooks();
66+
const { translate } = useTranslate();
6567

6668
return <>
6769
<button
6870
className="btn btn-outline-secondary permalink"
6971
data-toggle="modal"
7072
data-target="#wstool-1-permalink"
71-
title="Permalink"
73+
title={translate("Permalink")}
7274
onClick={openPermalinkModal}
7375
>
7476
<i className="fa fa-link"></i>

resources/dev-tools/components/websocket-api/right-sidebar.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,22 @@ export const RightSideBar: React.FC<RightSideBarProps> = ({
2525
<ul className="command-list" id="command_list">
2626
{commandList.map((list, index) => (
2727
<Fragment key={index}>
28-
<li className="separator">{list.group}</li>
28+
<li className="separator">
29+
{
30+
list.group.endsWith("Methods") ?
31+
`${list.group.replace('Methods', '')}${translate('Methods')}` :
32+
list.group.endsWith("Examples") ?
33+
`${list.group.replace('Examples', '')}${translate('Examples')}` :
34+
translate(list.group)
35+
}
36+
</li>
2937
{list.methods.map((method) => (
3038
<li
3139
className={`method${method === currentMethod ? " active" : ""}`}
3240
key={method.name}
3341
>
3442
<Link
35-
to={`resources/dev-tools/websocket-api-tool#${slugify(method.name)}`}
43+
to={`/resources/dev-tools/websocket-api-tool#${slugify(method.name)}`}
3644
onClick={() => setCurrentMethod(method)}
3745
>
3846
{method.name}&nbsp;
@@ -49,7 +57,7 @@ export const RightSideBar: React.FC<RightSideBarProps> = ({
4957
className="status clio_only"
5058
title="This method is only available from the Clio server."
5159
>
52-
<i className=" fa fa-exclamation-circle"></i>
60+
<i className="fa fa-exclamation-circle"></i>
5361
</span>
5462
)}
5563
</Link>

resources/dev-tools/domain-verifier.page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const DomainVerificationPage = () => {
154154
domain = hexToString(decodedManifest.Domain as string);
155155
} catch {
156156
addNewLogEntry(setLogEntries, {
157-
message: translate(`"Domain not found in manifest"`),
157+
message: translate(`Domain not found in manifest`),
158158
id: "no-domain",
159159
});
160160

@@ -175,7 +175,7 @@ const DomainVerificationPage = () => {
175175
const url = `https://${domain}${TOML_PATH}?v=${query_param++}`;
176176
const baseCheckingToml = {
177177
id: 'checking-toml',
178-
message: translate(`${translate('Checking ')} ${url}`)
178+
message: `${translate('resources.dev-tools.domain-verifier.checking.part1','Checking ')}${url}${translate('resources.dev-tools.domain-verifier.checking.part2','Checking')}}`
179179
}
180180
addNewLogEntry(setLogEntries, baseCheckingToml)
181181

resources/dev-tools/index.page.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const explorers_tools = [
3838
title: "Token List",
3939
description:
4040
"See all tokens issued in the XRP Ledger and use preset tools to issue custom tokens at the click of a button.",
41-
href: "https://xumm.community/tokens",
41+
href: "https://xrpl.services/tokens",
4242
img: require("../../static/img/dev-tools/tokenlist.png"),
4343
},
4444
];
@@ -48,7 +48,7 @@ const api_access_tools = [
4848
id: "websocket",
4949
title: "WebSocket Tool",
5050
description:
51-
"Send sample requests and get responses from the rippled API. ",
51+
"Send sample requests and get responses from the rippled API.",
5252
href: "websocket-api-tool",
5353
img: require("../../static/img/dev-tools/websocket-tool.png"),
5454
},
@@ -63,7 +63,7 @@ const api_access_tools = [
6363
{
6464
id: "technical-explorer",
6565
title: "Technical Explorer",
66-
description: "Browse API objects from the ledger with real-time updates. ",
66+
description: "Browse API objects from the ledger with real-time updates.",
6767
href: "https://explorer.xrplf.org/",
6868
img: require("../../static/img/dev-tools/technical-explorer.png"),
6969
},
@@ -130,7 +130,7 @@ export default function DevTools() {
130130
<div className="d-flex flex-column-reverse">
131131
<p className="mb-0">
132132
{translate(
133-
"Use the developer tools to test, explore, and validate XRP Ledger\n API requests and behavior."
133+
"Use the developer tools to test, explore, and validate XRP Ledger API requests and behavior."
134134
)}
135135
</p>
136136
<h3 className="eyebrow mb-3"> {translate("Dev Tools")}</h3>
@@ -204,8 +204,8 @@ export default function DevTools() {
204204
<img src={card.img} alt={`${card.title} Screenshot`} />
205205
)}
206206
<div className="card-body">
207-
<h4 className="card-title h5">{card.title}</h4>
208-
<p className="card-text">{card.description}</p>
207+
<h4 className="card-title h5">{translate(card.title)}</h4>
208+
<p className="card-text">{translate(card.description)}</p>
209209
</div>
210210
<div className="card-footer">&nbsp;</div>
211211
</a>
@@ -234,8 +234,8 @@ export default function DevTools() {
234234
)
235235
}
236236
<div className="card-body">
237-
<h4 className="card-title h5">{card.title}</h4>
238-
<p className="card-text">{card.description}</p>
237+
<h4 className="card-title h5">{translate(card.title)}</h4>
238+
<p className="card-text">{translate(card.description)}</p>
239239
</div>
240240
<div className="card-footer">&nbsp;</div>
241241
</a>
@@ -264,8 +264,8 @@ export default function DevTools() {
264264
)
265265
}
266266
<div className="card-body">
267-
<h4 className="card-title h5">{card.title}</h4>
268-
<p className="card-text">{card.description}</p>
267+
<h4 className="card-title h5">{translate(card.title)}</h4>
268+
<p className="card-text">{translate(card.description)}</p>
269269
</div>
270270
<div className="card-footer">&nbsp;</div>
271271
</a>

resources/dev-tools/rpc-tool.page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export default function RpcTool() {
198198
id="main_content_body"
199199
>
200200
<section className="container-fluid pt-3 p-md-3">
201-
<h1>RPC Tool</h1>
201+
<h1>{translate('RPC Tool')}</h1>
202202
<div className="content">
203203
<p>
204204
{translate(
@@ -218,8 +218,9 @@ export default function RpcTool() {
218218
/>
219219
<span className="help-block">
220220
<small>
221-
{translate("Try an account like ")}
222-
<em>rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn</em>.
221+
{translate("resourses.rpc-tool.help-block.part1", "Try an account like ")}
222+
<em>rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn</em>
223+
{translate("resourses.rpc-tool.help-block.part2", ".")}
223224
</small>
224225
</span>&nbsp;
225226
<button className="btn btn-primary" onClick={getInfo}>

resources/dev-tools/tx-sender.page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ function TxSenderBody(): React.JSX.Element {
181181
<section className="container-fluid pt-3 p-md-3">
182182
<h1>{translate("Transaction Sender")}</h1>
183183
<div className="content">
184-
<p>{translate("This tool sends transactions to the ")}
185-
<a href="dev-tools/xrp-faucets">{translate("XRP Testnet")}</a>
186-
{translate(" address of your choice so you can test how you monitor and respond to incoming transactions.")}
184+
<p>{translate("resources.dev-tool.tx-sender.content.part1", "This tool sends transactions to the ")}
185+
<a href="../xrp-faucets">{translate("XRP Testnet")}</a>
186+
{translate("resources.dev-tool.tx-sender.content.part2", " address of your choice so you can test how you monitor and respond to incoming transactions.")}
187187
</p>
188188
<form>
189189
<InitButton
@@ -223,7 +223,7 @@ function TxSenderBody(): React.JSX.Element {
223223
{{
224224
buttonText: "Send XRP Payment",
225225
units: "drops of XRP",
226-
longerDescription: (<div>{translate("Send a ")}<a href="send-xrp.html">{translate("simple XRP-to-XRP payment")}</a>{translate(".")}</div>),
226+
longerDescription: (<div>{translate("resources.dev-tool.tx-sender.send-xrp-desc.part1", "Send a ")}<a href="send-xrp.html">{translate("resources.dev-tool.tx-sender.send-xrp-desc.part2", "simple XRP-to-XRP payment")}</a>{translate("resources.dev-tool.tx-sender.send-xrp-desc.part3", ".")}</div>),
227227
}}
228228
inputSettings={
229229
{

0 commit comments

Comments
 (0)