Skip to content

Commit

Permalink
Mark bundles/translation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed Mar 23, 2024
1 parent 02bb77f commit 860327d
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 59 deletions.
14 changes: 13 additions & 1 deletion .github/fix-css.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import java.io.File
import kotlin.io.path.Path
import kotlin.io.path.writeText

val replacements: Map<String, String> = mapOf(
// Globe emoji 🌐
"\uD83C\uDF10" to "<a title=\"May be a translation key.\" href=\"/internationalisation.html\">\uD83C\uDF10</a>",

// Tag emoji 🏷️
"\uD83C\uDFF7\uFE0F" to "<a title=\"Translation bundle.\" href=\"/internationalisation.html\">\uD83C\uDF10</a>",
)

val docRoot = Path("docs/")
val client = OkHttpClient()

Expand Down Expand Up @@ -102,11 +110,15 @@ println("WriterSide CSS/JS downloaded")
files.forEach {
println("Updating HTML for file: ${it.name}")

val content = it.readText()
var content = it.readText()
.replace(jbCssLine, customCssHtml)
.replace(jbJsLine, customJsHtml)
// .replace(jbCopyrightLine, customCopyrightHtml)

replacements.forEach { (string, replacement) ->
content = content.replace(string, replacement)
}

it.writeText(content)
}

Expand Down
4 changes: 2 additions & 2 deletions Writerside/kordex.tree
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
start-page="Welcome.topic">

<toc-element topic="Welcome.topic"/>
<toc-element id="dokka :link" toc-title="Dokka API Docs" href="https://dokka.kordex.dev"/>
<toc-element id="dokka :link :div:bottom" toc-title="Dokka API Docs" href="https://dokka.kordex.dev"/>

<toc-element id="about :div:top" topic="About.topic">
<toc-element topic="About.topic">
<toc-element topic="Framework-Comparison.topic"/>
</toc-element>

Expand Down
9 changes: 8 additions & 1 deletion Writerside/topics/core/Checks.topic
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,14 @@
<chapter title="Properties" id="context-properties">
<table style="both">
<tr>
<td> </td>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>

<tr>
<td> </td>
<td><code>cache</code></td>
<td><code>MutableStringKeyedMap&lt;Any&gt;</code></td>

Expand All @@ -181,6 +183,7 @@
</tr>

<tr>
<td>🏷️</td>
<td><code>defaultBundle</code></td>
<td><code>String?</code></td>

Expand All @@ -190,6 +193,7 @@
</tr>

<tr>
<td>🌐</td>
<td><code>errorResponseKey</code></td>
<td><code>String</code></td>

Expand All @@ -202,6 +206,7 @@
</tr>

<tr>
<td> </td>
<td><code>event</code></td>
<td><code>T: Event</code></td>

Expand All @@ -211,6 +216,7 @@
</tr>

<tr>
<td> </td>
<td><code>locale</code></td>
<td><code>Locale</code></td>

Expand All @@ -222,6 +228,7 @@
</tr>

<tr>
<td> </td>
<td><code>message</code></td>
<td><code>String?</code></td>

Expand All @@ -232,7 +239,7 @@
</tr>

<tr>

<td> </td>
<td><code>passed</code></td>
<td><code>Boolean</code></td>

Expand Down
12 changes: 10 additions & 2 deletions Writerside/topics/core/Commands.topic
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,16 @@
Mutable properties may be set in the builder function used to register your command.
</p>

<table style="header-row">
<table style="both">
<tr>
<td> </td>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>

<tr>
<td>🏷️</td>
<td><code>bundle</code></td>
<td><code>String?</code></td>
<td>
Expand All @@ -248,13 +250,15 @@
</tr>

<tr>
<td> </td>
<td><code>extension</code></td>
<td><code>Extension</code></td>

<td>The extension that this command belongs to.</td>
</tr>

<tr>
<td> </td>
<td><code>kord</code></td>

<td>
Expand All @@ -267,6 +271,7 @@
</tr>

<tr>
<td> </td>
<td><code>locking</code></td>
<td><code>Boolean</code></td>

Expand All @@ -281,6 +286,7 @@
</tr>

<tr>
<td>🌐</td>
<td><code>name</code></td>
<td><code>String</code></td>

Expand All @@ -291,6 +297,7 @@
</tr>

<tr>
<td> </td>
<td><code>sentry</code></td>
<td>
<a href="Sentry.topic">
Expand All @@ -302,6 +309,7 @@
</tr>

<tr>
<td> </td>
<td><code>translationsProvider</code></td>

<td>
Expand Down Expand Up @@ -429,7 +437,7 @@
</tr>

<tr>
<td><code>bundle</code></td>
<td>🏷️ <code>bundle</code></td>
<td><code>String?</code></td>

<td>The command's translation bundle, falling back to the extension's if not defined.</td>
Expand Down
9 changes: 7 additions & 2 deletions Writerside/topics/core/Exceptions.topic
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="Exceptions" id="Exceptions">

<show-structure depth="2"/>

<p>
Kord Extensions provides a number of extra exception types.
These are useful for understanding precisely what went wrong in specific situations, but there are some
Expand Down Expand Up @@ -37,14 +39,16 @@
This exception supports the following extra properties:
</p>

<table style="header-row">
<table style="both">
<tr>
<td> </td>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>

<tr>
<td> </td>
<td><code>reason</code></td>
<td><code>String</code></td>

Expand All @@ -54,6 +58,7 @@
</tr>

<tr>
<td>🌐</td>
<td><code>translationKey</code></td>
<td><code>String?</code></td>

Expand Down Expand Up @@ -109,7 +114,7 @@
</tr>

<tr>
<td><code>bundle</code></td>
<td>🏷️ <code>bundle</code></td>
<td><code>String?</code></td>

<td>
Expand Down
2 changes: 1 addition & 1 deletion Writerside/topics/core/Extensions.topic
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
</tr>

<tr>
<td><code>bundle</code></td>
<td>🏷️ <code>bundle</code></td>
<td><code>String?</code></td>
<td><code>null</code></td>

Expand Down
10 changes: 7 additions & 3 deletions Writerside/topics/core/commands/Application-Commands.topic
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,22 @@
</chapter>

<chapter title="Properties" id="command-properties">
<table style="header-row">
<table style="both">
<tr>
<td> </td>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>

<tr id="command-properties-required:header:text:center">
<td colspan="3">
<td colspan="4">
Required Properties
</td>
</tr>

<tr>
<td>🌐</td>
<td><code>name</code></td>
<td><code>String</code></td>

Expand All @@ -141,12 +143,13 @@
</tr>

<tr id="command-properties-optional:header:text:center">
<td colspan="3">
<td colspan="4">
Optional Properties
</td>
</tr>

<tr>
<td> </td>
<td><code>allowByDefault</code></td>
<td><code>Boolean</code></td>

Expand All @@ -160,6 +163,7 @@
</tr>

<tr>
<td> </td>
<td><code>allowInDms</code></td>
<td><code>Boolean</code></td>

Expand Down
20 changes: 15 additions & 5 deletions Writerside/topics/core/commands/Chat-Commands.topic
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,22 @@
</chapter>

<chapter title="Properties" id="standalone-properties">
<table style="header-row">
<table style="both">
<tr>
<td> </td>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>

<tr id="standalone-properties-required:header:text:center">
<td colspan="3">
<td colspan="4">
Required Properties
</td>
</tr>

<tr>
<td>🌐</td>
<td><code>description</code></td>
<td><code>String</code></td>

Expand All @@ -258,6 +260,7 @@
</tr>

<tr>
<td>🌐</td>
<td><code>name</code></td>
<td><code>String</code></td>

Expand All @@ -269,12 +272,13 @@
</tr>

<tr id="standalone-properties-optional:header:text:center">
<td colspan="3">
<td colspan="4">
Optional Properties
</td>
</tr>

<tr>
<td> </td>
<td><code>aliases</code></td>
<td><code>Array &lt;String&gt;</code></td>

Expand All @@ -286,6 +290,7 @@
</tr>

<tr>
<td> </td>
<td><code>allowKeywordArguments</code></td>
<td><code>Boolean</code></td>

Expand All @@ -297,6 +302,7 @@
</tr>

<tr>
<td> </td>
<td><code>enabled</code></td>
<td><code>Boolean</code></td>

Expand All @@ -308,6 +314,7 @@
</tr>

<tr>
<td> </td>
<td><code>hidden</code></td>
<td><code>Boolean</code></td>

Expand All @@ -319,6 +326,7 @@
</tr>

<tr>
<td> </td>
<td><code>localeFallback</code></td>
<td><code>Boolean</code></td>

Expand All @@ -332,12 +340,13 @@
</tr>

<tr id="standalone-properties-translation:header:text:center">
<td colspan="3">
<td colspan="4">
Translation-Related Properties
</td>
</tr>

<tr>
<td>🌐</td>
<td><code>aliasKey</code></td>
<td><code>String?</code></td>

Expand All @@ -349,6 +358,7 @@
</tr>

<tr>
<td>🌐</td>
<td><code>signature</code></td>
<td><code>String?</code></td>

Expand Down Expand Up @@ -535,7 +545,7 @@
<td><code>Message.respondTranslated</code></td>

<td>
<a href="Internationalisation.topic"><code>key</code></a>,
<a href="Internationalisation.topic">🌐 <code>key</code></a>,
<a href="Internationalisation.topic"><code>replacements</code></a>,
<code>useReply = true</code>
</td>
Expand Down
Loading

0 comments on commit 860327d

Please sign in to comment.