Skip to content

Commit

Permalink
docs: small refactor of tr-progress & contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Jan 5, 2024
1 parent fbf898c commit 438e880
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
46 changes: 23 additions & 23 deletions assets/translations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
### Translation progress:
| Locale | Translated keys | Based on |
| ------ | --------------- | :------: |
| `en_US` | 120 (default locale) | |
| `de_DE` | 🚫 `97/120` (80.8%) ||
| `en_UK` |`120/120` (100.0%) | `en_US` |
| `es_ES` | 🚫 `97/120` (80.8%) ||
| `fr_FR` | 🚫 `97/120` (80.8%) ||
| `hi_IN` | 🚫 `97/120` (80.8%) ||
| `ja_JA` | 🚫 `97/120` (80.8%) ||
| `pt_BR` | 🚫 `97/120` (80.8%) ||
| `zh_CN` | 🚫 `97/120` (80.8%) ||
| [`en_US`](./en_US.json) | 120 (default locale) | |
| [`de_DE`](./de_DE.json) | 🚫 `97/120` (80.8%) ||
| [`en_UK`](./en_UK.json) |`120/120` (100.0%) | `en_US` |
| [`es_ES`](./es_ES.json) | 🚫 `97/120` (80.8%) ||
| [`fr_FR`](./fr_FR.json) | 🚫 `97/120` (80.8%) ||
| [`hi_IN`](./hi_IN.json) | 🚫 `97/120` (80.8%) ||
| [`ja_JA`](./ja_JA.json) | 🚫 `97/120` (80.8%) ||
| [`pt_BR`](./pt_BR.json) | 🚫 `97/120` (80.8%) ||
| [`zh_CN`](./zh_CN.json) | 🚫 `97/120` (80.8%) ||

<br>

Expand All @@ -25,7 +25,7 @@ This means you need to manually check against the base translations for missing

### Missing keys:

<details><summary><code>de_DE</code> - 23 missing keys (click to show)</summary>
<details><summary><code>de_DE</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -53,9 +53,9 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>

<details><summary><code>es_ES</code> - 23 missing keys (click to show)</summary>
<details><summary><code>es_ES</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -83,9 +83,9 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>

<details><summary><code>fr_FR</code> - 23 missing keys (click to show)</summary>
<details><summary><code>fr_FR</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -113,9 +113,9 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>

<details><summary><code>hi_IN</code> - 23 missing keys (click to show)</summary>
<details><summary><code>hi_IN</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -143,9 +143,9 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>

<details><summary><code>ja_JA</code> - 23 missing keys (click to show)</summary>
<details><summary><code>ja_JA</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -173,9 +173,9 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>

<details><summary><code>pt_BR</code> - 23 missing keys (click to show)</summary>
<details><summary><code>pt_BR</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -203,9 +203,9 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>

<details><summary><code>zh_CN</code> - 23 missing keys (click to show)</summary>
<details><summary><code>zh_CN</code> - 23 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
Expand Down Expand Up @@ -233,4 +233,4 @@ This means you need to manually check against the base translations for missing
| `feature_helptext_anchorImprovements` | `Some elements on the page are only clickable with the left mouse button, which means you can't open them in a new tab by middle-clicking or through the context menu using shift + right-click. This feature adds links to a lot of them or enlarges existing ones to make clicking easier.` |
| `feature_helptext_logLevel` | `This is really only needed for debugging purposes. If you have a problem with the userscript, you should set this to a verbose setting so you can include the JavaScript console log in your GitHub issue.` |

</details>
<br></details>
16 changes: 8 additions & 8 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ If you need specific events to be added or modified, please [submit an issue.](h

<br>

<details><summary>Static interaction example - click to expand</summary>
<details><summary>Static interaction <b>Example <i>(click to expand)</i></b></summary>

#### Example:
```ts
Expand All @@ -153,7 +153,7 @@ console.log(`BetterYTM's version is '${BYTM.version} #${BYTM.buildNumber}'`);

<br>

<details><summary>Dynamic interaction examples - click to expand</summary>
<details><summary>Dynamic interaction examples <i>(click to expand)</i></summary>

#### Basic format:
```ts
Expand Down Expand Up @@ -254,7 +254,7 @@ An easy way to do this might be to include BetterYTM as a Git submodule, as long
> - `selector` - The CSS selector to observe for changes.
> - `options` - The options for the listener. See the [UserUtils SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils#selectorobserver)
>
> <details><summary>Example - click to expand</summary>
> <details><summary><b>Example <i>(click to expand)</i></b></summary>
>
> ```ts
> // wait for the observers to exist
Expand Down Expand Up @@ -289,7 +289,7 @@ An easy way to do this might be to include BetterYTM as a Git submodule, as long
> Arguments:
> - `resourceName` - The name of the resource to get the URL for.
>
> <details><summary>Example - click to expand</summary>
> <details><summary><b>Example <i>(click to expand)</i></b></summary>
>
> ```ts
> const deleteButtonImg = document.createElement("img");
Expand All @@ -311,7 +311,7 @@ An easy way to do this might be to include BetterYTM as a Git submodule, as long
> Returns the unique session ID that is generated on every page load.
> It should persist between history navigations, but not between page reloads.
>
> <details><summary>Example - click to expand</summary>
> <details><summary><b>Example <i>(click to expand)</i></b></summary>
>
> ```ts
> const sessionId = unsafeWindow.BYTM.getSessionId();
Expand All @@ -337,7 +337,7 @@ An easy way to do this might be to include BetterYTM as a Git submodule, as long
> In order for that edge case not to throw an error, the function would need to be called in response to a user interaction event (e.g. click) due to the strict automated interaction policy in browsers.
> Resolves with a number of seconds or `null` if the time couldn't be determined.
>
> <details><summary>Example - click to expand</summary>
> <details><summary><b>Example <i>(click to expand)</i></b></summary>
>
> ```ts
> try {
Expand Down Expand Up @@ -366,7 +366,7 @@ An easy way to do this might be to include BetterYTM as a Git submodule, as long
> - `translationKey` - The key of the translation to get.
> - `...values` - A spread parameter of values that can be converted to strings to replace the numbered placeholders in the translation with.
>
> <details><summary>Example - click to expand</summary>
> <details><summary><b>Example <i>(click to expand)</i></b></summary>
>
> ```ts
> const customConfigMenuTitle = document.createElement("div");
Expand Down Expand Up @@ -395,7 +395,7 @@ An easy way to do this might be to include BetterYTM as a Git submodule, as long
> - `num` - The number of items to determine the pluralization identifier from. Can also be an array or NodeList.
> - `...values` - A spread parameter of values that can be converted to strings to replace the numbered placeholders in the translation with.
>
> <details><summary>Example - click to expand</summary>
> <details><summary><b>Example <i>(click to expand)</i></b></summary>
>
> ```ts
> try {
Expand Down
6 changes: 3 additions & 3 deletions src/tools/tr-progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function run() {

const baseTr = trFiles[locale as TrLocale]?.base;

tableLines.push(`| \`${locale}\` | ${keysCol} | ${baseTr ? `\`${baseTr}\`` : (locale === "en_US" ? "" : "─")} |`);
tableLines.push(`| [\`${locale}\`](./${locale}.json) | ${keysCol} | ${baseTr ? `\`${baseTr}\`` : (locale === "en_US" ? "" : "─")} |`);
console.log(` ${sym} ${locale}: ${trKeys}/${origKeys} (${percent}%)${baseTr ? ` (base: ${baseTr})`: ""}`);
}

Expand All @@ -80,11 +80,11 @@ async function run() {
}
if(lines.length > 0) {
missingKeys.push(`
<details><summary><code>${locale}</code> - ${lines.length} missing ${autoPlural("key", lines)} (click to show)</summary>\n
<details><summary><code>${locale}</code> - ${lines.length} missing ${autoPlural("key", lines)} <i>(click to show)</i></summary><br>\n
| Key | English text |
| --- | ------------ |
${lines.join("\n")}\n
</details>`);
<br></details>`);
}
}

Expand Down

0 comments on commit 438e880

Please sign in to comment.