Skip to content

Commit

Permalink
feat: translatable names for PluginIntent enum mebmers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Nov 23, 2024
1 parent c674fae commit e53d111
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 17 deletions.
78 changes: 63 additions & 15 deletions assets/translations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
### Translation progress:
|   | Locale | Translated keys | Based on |
| :----: | ------ | --------------- | :------: |
| | [`en-US`](./en-US.json) | `329` (default locale) | |
|| [`de-DE`](./de-DE.json) | `329/329` (100%) ||
| | [`en-GB`](./en-GB.json) | `329/329` (100%) | `en-US` |
|| [`es-ES`](./es-ES.json) | `322/329` (97.9%) ||
|| [`fr-FR`](./fr-FR.json) | `322/329` (97.9%) ||
|| [`hi-IN`](./hi-IN.json) | `322/329` (97.9%) ||
|| [`ja-JP`](./ja-JP.json) | `322/329` (97.9%) ||
|| [`pt-BR`](./pt-BR.json) | `322/329` (97.9%) ||
|| [`zh-CN`](./zh-CN.json) | `322/329` (97.9%) ||
| | [`en-US`](./en-US.json) | `337` (default locale) | |
|| [`de-DE`](./de-DE.json) | `337/337` (100%) ||
| | [`en-GB`](./en-GB.json) | `337/337` (100%) | `en-US` |
|| [`es-ES`](./es-ES.json) | `322/337` (95.5%) ||
|| [`fr-FR`](./fr-FR.json) | `322/337` (95.5%) ||
|| [`hi-IN`](./hi-IN.json) | `322/337` (95.5%) ||
|| [`ja-JP`](./ja-JP.json) | `322/337` (95.5%) ||
|| [`pt-BR`](./pt-BR.json) | `322/337` (95.5%) ||
|| [`zh-CN`](./zh-CN.json) | `322/337` (95.5%) ||

<sub>
✅ - Fully translated
Expand All @@ -45,83 +45,131 @@ This means to figure out which keys are untranslated, you will need to manually

### Missing keys:

<details><summary><code>es-ES</code> - 7 missing keys <i>(click to show)</i></summary><br>
<details><summary><code>es-ES</code> - 15 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
| `reset_everything_confirm` | `Do you really want to reset all stored data to the default values?\nThe page will be automatically reloaded.` |
| `open_current_lyrics` | `Open the current song's lyrics in a new tab - shift-click to open in a new window or ctrl-click to open manual search` |
| `open_lyrics` | `Open this song's lyrics in a new tab - ctrl-click to open manual search` |
| `plugin_intent_name_ReadFeatureConfig` | `Read Feature Config` |
| `plugin_intent_name_WriteFeatureConfig` | `Write Feature Config` |
| `plugin_intent_name_SeeHiddenConfigValues` | `See Hidden Config Values` |
| `plugin_intent_name_WriteLyricsCache` | `Write Lyrics Cache` |
| `plugin_intent_name_WriteTranslations` | `Write Translations` |
| `plugin_intent_name_CreateModalDialogs` | `Create Modal Dialogs` |
| `plugin_intent_name_ReadAutoLikeData` | `Read Auto-Like Data` |
| `plugin_intent_name_WriteAutoLikeData` | `Write Auto-Like Data` |
| `feature_desc_aboveQueueBtnsSticky` | `Always position the element containing the buttons above the queue at the top of the list` |
| `feature_desc_resetEverything` | `Reset all stored data to the default values` |
| `feature_btn_resetEverything` | `Reset everything` |
| `feature_btn_resetEverything_running` | `Resetting...` |

<br></details>

<details><summary><code>fr-FR</code> - 7 missing keys <i>(click to show)</i></summary><br>
<details><summary><code>fr-FR</code> - 15 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
| `reset_everything_confirm` | `Do you really want to reset all stored data to the default values?\nThe page will be automatically reloaded.` |
| `open_current_lyrics` | `Open the current song's lyrics in a new tab - shift-click to open in a new window or ctrl-click to open manual search` |
| `open_lyrics` | `Open this song's lyrics in a new tab - ctrl-click to open manual search` |
| `plugin_intent_name_ReadFeatureConfig` | `Read Feature Config` |
| `plugin_intent_name_WriteFeatureConfig` | `Write Feature Config` |
| `plugin_intent_name_SeeHiddenConfigValues` | `See Hidden Config Values` |
| `plugin_intent_name_WriteLyricsCache` | `Write Lyrics Cache` |
| `plugin_intent_name_WriteTranslations` | `Write Translations` |
| `plugin_intent_name_CreateModalDialogs` | `Create Modal Dialogs` |
| `plugin_intent_name_ReadAutoLikeData` | `Read Auto-Like Data` |
| `plugin_intent_name_WriteAutoLikeData` | `Write Auto-Like Data` |
| `feature_desc_aboveQueueBtnsSticky` | `Always position the element containing the buttons above the queue at the top of the list` |
| `feature_desc_resetEverything` | `Reset all stored data to the default values` |
| `feature_btn_resetEverything` | `Reset everything` |
| `feature_btn_resetEverything_running` | `Resetting...` |

<br></details>

<details><summary><code>hi-IN</code> - 7 missing keys <i>(click to show)</i></summary><br>
<details><summary><code>hi-IN</code> - 15 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
| `reset_everything_confirm` | `Do you really want to reset all stored data to the default values?\nThe page will be automatically reloaded.` |
| `open_current_lyrics` | `Open the current song's lyrics in a new tab - shift-click to open in a new window or ctrl-click to open manual search` |
| `open_lyrics` | `Open this song's lyrics in a new tab - ctrl-click to open manual search` |
| `plugin_intent_name_ReadFeatureConfig` | `Read Feature Config` |
| `plugin_intent_name_WriteFeatureConfig` | `Write Feature Config` |
| `plugin_intent_name_SeeHiddenConfigValues` | `See Hidden Config Values` |
| `plugin_intent_name_WriteLyricsCache` | `Write Lyrics Cache` |
| `plugin_intent_name_WriteTranslations` | `Write Translations` |
| `plugin_intent_name_CreateModalDialogs` | `Create Modal Dialogs` |
| `plugin_intent_name_ReadAutoLikeData` | `Read Auto-Like Data` |
| `plugin_intent_name_WriteAutoLikeData` | `Write Auto-Like Data` |
| `feature_desc_aboveQueueBtnsSticky` | `Always position the element containing the buttons above the queue at the top of the list` |
| `feature_desc_resetEverything` | `Reset all stored data to the default values` |
| `feature_btn_resetEverything` | `Reset everything` |
| `feature_btn_resetEverything_running` | `Resetting...` |

<br></details>

<details><summary><code>ja-JP</code> - 7 missing keys <i>(click to show)</i></summary><br>
<details><summary><code>ja-JP</code> - 15 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
| `reset_everything_confirm` | `Do you really want to reset all stored data to the default values?\nThe page will be automatically reloaded.` |
| `open_current_lyrics` | `Open the current song's lyrics in a new tab - shift-click to open in a new window or ctrl-click to open manual search` |
| `open_lyrics` | `Open this song's lyrics in a new tab - ctrl-click to open manual search` |
| `plugin_intent_name_ReadFeatureConfig` | `Read Feature Config` |
| `plugin_intent_name_WriteFeatureConfig` | `Write Feature Config` |
| `plugin_intent_name_SeeHiddenConfigValues` | `See Hidden Config Values` |
| `plugin_intent_name_WriteLyricsCache` | `Write Lyrics Cache` |
| `plugin_intent_name_WriteTranslations` | `Write Translations` |
| `plugin_intent_name_CreateModalDialogs` | `Create Modal Dialogs` |
| `plugin_intent_name_ReadAutoLikeData` | `Read Auto-Like Data` |
| `plugin_intent_name_WriteAutoLikeData` | `Write Auto-Like Data` |
| `feature_desc_aboveQueueBtnsSticky` | `Always position the element containing the buttons above the queue at the top of the list` |
| `feature_desc_resetEverything` | `Reset all stored data to the default values` |
| `feature_btn_resetEverything` | `Reset everything` |
| `feature_btn_resetEverything_running` | `Resetting...` |

<br></details>

<details><summary><code>pt-BR</code> - 7 missing keys <i>(click to show)</i></summary><br>
<details><summary><code>pt-BR</code> - 15 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
| `reset_everything_confirm` | `Do you really want to reset all stored data to the default values?\nThe page will be automatically reloaded.` |
| `open_current_lyrics` | `Open the current song's lyrics in a new tab - shift-click to open in a new window or ctrl-click to open manual search` |
| `open_lyrics` | `Open this song's lyrics in a new tab - ctrl-click to open manual search` |
| `plugin_intent_name_ReadFeatureConfig` | `Read Feature Config` |
| `plugin_intent_name_WriteFeatureConfig` | `Write Feature Config` |
| `plugin_intent_name_SeeHiddenConfigValues` | `See Hidden Config Values` |
| `plugin_intent_name_WriteLyricsCache` | `Write Lyrics Cache` |
| `plugin_intent_name_WriteTranslations` | `Write Translations` |
| `plugin_intent_name_CreateModalDialogs` | `Create Modal Dialogs` |
| `plugin_intent_name_ReadAutoLikeData` | `Read Auto-Like Data` |
| `plugin_intent_name_WriteAutoLikeData` | `Write Auto-Like Data` |
| `feature_desc_aboveQueueBtnsSticky` | `Always position the element containing the buttons above the queue at the top of the list` |
| `feature_desc_resetEverything` | `Reset all stored data to the default values` |
| `feature_btn_resetEverything` | `Reset everything` |
| `feature_btn_resetEverything_running` | `Resetting...` |

<br></details>

<details><summary><code>zh-CN</code> - 7 missing keys <i>(click to show)</i></summary><br>
<details><summary><code>zh-CN</code> - 15 missing keys <i>(click to show)</i></summary><br>

| Key | English text |
| --- | ------------ |
| `reset_everything_confirm` | `Do you really want to reset all stored data to the default values?\nThe page will be automatically reloaded.` |
| `open_current_lyrics` | `Open the current song's lyrics in a new tab - shift-click to open in a new window or ctrl-click to open manual search` |
| `open_lyrics` | `Open this song's lyrics in a new tab - ctrl-click to open manual search` |
| `plugin_intent_name_ReadFeatureConfig` | `Read Feature Config` |
| `plugin_intent_name_WriteFeatureConfig` | `Write Feature Config` |
| `plugin_intent_name_SeeHiddenConfigValues` | `See Hidden Config Values` |
| `plugin_intent_name_WriteLyricsCache` | `Write Lyrics Cache` |
| `plugin_intent_name_WriteTranslations` | `Write Translations` |
| `plugin_intent_name_CreateModalDialogs` | `Create Modal Dialogs` |
| `plugin_intent_name_ReadAutoLikeData` | `Read Auto-Like Data` |
| `plugin_intent_name_WriteAutoLikeData` | `Write Auto-Like Data` |
| `feature_desc_aboveQueueBtnsSticky` | `Always position the element containing the buttons above the queue at the top of the list` |
| `feature_desc_resetEverything` | `Reset all stored data to the default values` |
| `feature_btn_resetEverything` | `Reset everything` |
Expand Down
10 changes: 9 additions & 1 deletion assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,21 @@
"plugin_link_type_greasyfork": "GreasyFork",
"plugin_link_type_openuserjs": "OpenUserJS",

"plugin_intent_name_ReadFeatureConfig": "Konfiguration lesen",
"plugin_intent_description_ReadFeatureConfig": "Dieses Plugin kann die Feature-Konfiguration lesen",
"plugin_intent_name_WriteFeatureConfig": "Konfiguration überschreiben",
"plugin_intent_description_WriteFeatureConfig": "Dieses Plugin kann die Feature-Konfiguration überschreiben",
"plugin_intent_name_SeeHiddenConfigValues": "Versteckte Werte lesen",
"plugin_intent_description_SeeHiddenConfigValues": "Dieses Plugin kann versteckte Konfigurationswerte lesen",
"plugin_intent_name_WriteLyricsCache": "Songtext-Cache überschreiben",
"plugin_intent_description_WriteLyricsCache": "Dieses Plugin kann den Songtext-Cache überschreiben",
"plugin_intent_name_WriteTranslations": "Übersetzungen überschreiben",
"plugin_intent_description_WriteTranslations": "Dieses Plugin kann neue Übersetzungen hinzufügen und bestehende überschreiben",
"plugin_intent_description_CreateModalDialogs": "Dieses Plugin kann modale Dialoge erstellen",
"plugin_intent_name_CreateModalDialogs": "Modale Dialoge erzeugen",
"plugin_intent_description_CreateModalDialogs": "Dieses Plugin kann modale Dialoge erzeugen",
"plugin_intent_name_ReadAutoLikeData": "Auto-Like-Daten lesen",
"plugin_intent_description_ReadAutoLikeData": "Dieses Plugin kann Auto-Like-Daten lesen",
"plugin_intent_name_WriteAutoLikeData": "Auto-Like-Daten überschreiben",
"plugin_intent_description_WriteAutoLikeData": "Dieses Plugin kann Auto-Like-Daten überschreiben",

"plugin_validation_error_no_property": "Keine Eigenschaft '%1' vom Typ '%2'",
Expand Down
8 changes: 8 additions & 0 deletions assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,21 @@
"plugin_link_type_greasyfork": "GreasyFork",
"plugin_link_type_openuserjs": "OpenUserJS",

"plugin_intent_name_ReadFeatureConfig": "Read Feature Config",
"plugin_intent_description_ReadFeatureConfig": "This plugin can read the feature configuration",
"plugin_intent_name_WriteFeatureConfig": "Write Feature Config",
"plugin_intent_description_WriteFeatureConfig": "This plugin can write to the feature configuration",
"plugin_intent_name_SeeHiddenConfigValues": "See Hidden Config Values",
"plugin_intent_description_SeeHiddenConfigValues": "This plugin has access to hidden config values",
"plugin_intent_name_WriteLyricsCache": "Write Lyrics Cache",
"plugin_intent_description_WriteLyricsCache": "This plugin can write to the lyrics cache",
"plugin_intent_name_WriteTranslations": "Write Translations",
"plugin_intent_description_WriteTranslations": "This plugin can add new translations and overwrite existing ones",
"plugin_intent_name_CreateModalDialogs": "Create Modal Dialogs",
"plugin_intent_description_CreateModalDialogs": "This plugin can create modal dialogs",
"plugin_intent_name_ReadAutoLikeData": "Read Auto-Like Data",
"plugin_intent_description_ReadAutoLikeData": "This plugin can read auto-like data",
"plugin_intent_name_WriteAutoLikeData": "Write Auto-Like Data",
"plugin_intent_description_WriteAutoLikeData": "This plugin can write to auto-like data",

"plugin_validation_error_no_property": "No property '%1' with type '%2'",
Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/pluginList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async function renderBody() {
const intentEl = document.createElement("div");
intentEl.classList.add("bytm-plugin-list-row-intent-item");
intentEl.tabIndex = 0;
intentEl.textContent = PluginIntent[intent];
intentEl.textContent = t(`plugin_intent_name_${PluginIntent[intent]}`);
intentEl.title = intentEl.ariaLabel = t(`plugin_intent_description_${PluginIntent[intent]}`);
rightEl.appendChild(intentEl);
}
Expand Down

0 comments on commit e53d111

Please sign in to comment.