Skip to content

Commit de68cb5

Browse files
committed
fix: don't translate configuration keys+values
1 parent c1b85f3 commit de68cb5

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ For that, you can use the `jd:project_name[:module_name][:class_or_member_refere
157157
```md
158158
[my `Event` link](jd:paper:org.bukkit.event.Event)
159159
[`ProxyInitializeEvent`](jd:velocity:com.velocitypowered.api.event.proxy.ProxyInitializeEvent)
160-
[`repeat(long, TimeUnit)`](<jd:velocity:com.velocitypowered.api.scheduler.Scheduler$TaskBuilder#repeat(long,java.util.concurrent.TimeUnit)>)
160+
[`repeat(long, TimeUnit)`](jd:velocity:com.velocitypowered.api.scheduler.Scheduler$TaskBuilder#repeat(long,java.util.concurrent.TimeUnit))
161161
[java.base's List](jd:java:java.util.List)
162162
[java.sql's Connection](jd:java:java.sql:java.sql.Connection)
163163
```

src/components/ConfigNode.astro

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ const formatDefault = (value?: string): Default => {
4242
const childPath = [...path, key.replace(/-/g, "_")];
4343

4444
const def = formatDefault(value.default);
45-
// this is ugly, but the spans don't play nice otherwise
46-
const defValue = def.inline ? (<span class="value">{def.value}</span><a class="link" href={`#${childPath.join("_")}`}>#</a>) : (<a class="link" href={`#${childPath.join("_")}`}>#</a><p class="value">{def.value}</p>);
4745
return (
4846
<div>
4947
{"message" in value ? (
@@ -54,13 +52,17 @@ const formatDefault = (value?: string): Default => {
5452
/>
5553
) : "description" in value ? (
5654
<details id={childPath.join("_")}>
57-
<summary class="line">
58-
<span class="key">{displayKey}{separator ?? ": "}</span>{defValue}
55+
<summary class="line notranslate" translate="no">
56+
<span class="key">{displayKey}{separator ?? ": "}</span>{
57+
def.inline
58+
? (<span class="value">{def.value}</span><a class="link" href={`#${childPath.join("_")}`}>#</a>)
59+
: (<a class="link" href={`#${childPath.join("_")}`}>#</a><p class="value">{def.value}</p>)
60+
}
5961
</summary>
6062
<div class="block" set:html={render(value.description)} />
6163
</details>
6264
) : (
63-
<span class="key">{displayKey}:</span>
65+
<span class="key notranslate" translate="no">{displayKey}:</span>
6466
<Astro.self data={value} path={childPath} {separator} />
6567
)}
6668
</div>

0 commit comments

Comments
 (0)