瀏覽代碼

feat: translatable names for PluginIntent enum mebmers

Sv443 5 月之前
父節點
當前提交
e53d111c32
共有 4 個文件被更改,包括 81 次插入17 次删除
  1. 63 15
      assets/translations/README.md
  2. 9 1
      assets/translations/de-DE.json
  3. 8 0
      assets/translations/en-US.json
  4. 1 1
      src/dialogs/pluginList.ts

+ 63 - 15
assets/translations/README.md

@@ -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
@@ -45,13 +45,21 @@ 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` |
@@ -59,13 +67,21 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <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` |
@@ -73,13 +89,21 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <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` |
@@ -87,13 +111,21 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <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` |
@@ -101,13 +133,21 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <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` |
@@ -115,13 +155,21 @@ This means to figure out which keys are untranslated, you will need to manually
 
 <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` |

+ 9 - 1
assets/translations/de-DE.json

@@ -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'",

+ 8 - 0
assets/translations/en-US.json

@@ -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'",

+ 1 - 1
src/dialogs/pluginList.ts

@@ -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);
     }