Преглед изворни кода

fix: better readme gen & language names

Sv443 пре 1 година
родитељ
комит
057edc34d9
4 измењених фајлова са 6 додато и 29 уклоњено
  1. 1 1
      README-summary.md
  2. 1 1
      README.md
  3. 2 2
      assets/locales.json
  4. 2 25
      src/tools/gen-readme.ts

+ 1 - 1
README-summary.md

@@ -2,7 +2,7 @@
 <h1><img src="https://raw.githubusercontent.com/Sv443/BetterYTM/main/assets/images/logo/logo_128.png" width="96" height="96" /><br>BetterYTM</h1>
 
 ### Lots of configurable layout and user experience improvements for YouTube Music
-Supported Languages: 🇩🇪 German, 🇺🇸 English, 🇩🇪 German, 🇪🇸 Spanish, 🇫🇷 French, 🇮🇳 Hindi, 🇯🇵 Japanese, 🇵🇹 Portuguese, 🇨🇳 Chinese (simpl.)
+Supported Languages: 🇩🇪&nbsp;German, 🇺🇸&nbsp;English (US), 🇬🇧&nbsp;English (UK), 🇪🇸&nbsp;Spanish, 🇫🇷&nbsp;French, 🇮🇳&nbsp;Hindi, 🇯🇵&nbsp;Japanese, 🇵🇹&nbsp;Portuguese, 🇨🇳&nbsp;Chinese (simpl.)
 <!-- </{{HEADER}}> -->
 [**Features**](#features) • [**Installation**](#installation) • [**Plugins**](#plugins) • [**Support**](#support) • [**Development**](#development) • [**Attributions**](#attributions) • [**Disclaimers**](#disclaimers)
   

+ 1 - 1
README.md

@@ -3,7 +3,7 @@
 <h1><img src="https://raw.githubusercontent.com/Sv443/BetterYTM/main/assets/images/logo/logo_128.png" width="96" height="96" /><br>BetterYTM</h1>
 
 ### Lots of configurable layout and user experience improvements for YouTube Music
-Supported Languages: 🇩🇪 German, 🇺🇸 English, 🇬🇧 English, 🇪🇸 Spanish, 🇫🇷 French, 🇮🇳 Hindi, 🇯🇵 Japanese, 🇵🇹 Portuguese, 🇨🇳 Chinese (simpl.)
+Supported Languages: 🇩🇪&nbsp;German, 🇺🇸&nbsp;English (US), 🇬🇧&nbsp;English (UK), 🇪🇸&nbsp;Spanish, 🇫🇷&nbsp;French, 🇮🇳&nbsp;Hindi, 🇯🇵&nbsp;Japanese, 🇵🇹&nbsp;Portuguese, 🇨🇳&nbsp;Chinese (simpl.)
 <!-- </{{HEADER}}> -->
 [**Features**](#features) • [**Installation**](#installation) • [**Plugins**](#plugins) • [**Support**](#support) • [**Development**](#development) • [**Attributions**](#attributions) • [**Disclaimers**](#disclaimers)
   

+ 2 - 2
assets/locales.json

@@ -8,14 +8,14 @@
   },
   "en_US": {
     "name": "English (United States)",
-    "nameEnglish": "English",
+    "nameEnglish": "English (US)",
     "emoji": "🇺🇸",
     "userscriptDesc": "Configurable layout and user experience improvements for YouTube Music",
     "authors": ["Sv443"]
   },
   "en_UK": {
     "name": "English (United Kingdom)",
-    "nameEnglish": "English",
+    "nameEnglish": "English (UK)",
     "emoji": "🇬🇧",
     "userscriptDesc": "Configurable layout and user experience improvements for YouTube Music",
     "authors": ["Sv443"]

+ 2 - 25
src/tools/gen-readme.ts

@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
 import locales from "../../assets/locales.json" assert { type: "json" };
 import pluginsJson from "../../assets/plugins.json" assert { type: "json" };
 import pkg from "../../package.json" assert { type: "json" };
+import type { PluginDef } from "../types";
 
 const readmePath = join(fileURLToPath(import.meta.url), "../../../README.md");
 const readmeSummaryPath = join(fileURLToPath(import.meta.url), "../../../README-summary.md");
@@ -13,31 +14,7 @@ const changes = {
   PLUGINS: genPluginList,
 };
 
-type PluginObj = {
-  /** Name of the plugin */
-  pluginName: string;
-  /**
-   * Descriptions of at least en_US and optionally any other existing locale  
-   * When an unspecified locale is set, the description will default to either the base locale's value or en_US' value
-   */
-  pluginDescription: Partial<Record<keyof typeof locales, string>> & {
-    en_US: string;
-  };
-  /** Path relative to the project root */
-  pluginIconPath: string;
-  /** URL to the plugin's homepage or GitHub repo */
-  pluginUrl: string;
-  /** URL to the plugin's GreasyFork page */
-  pluginUrlGF?: string;
-  /** URL to the plugin's OpenUserJS page */
-  pluginUrlOUJS?: string;
-  /** Name of the plugin's author */
-  authorName: string;
-  /** URL to the plugin author's homepage / GitHub profile */
-  authorUrl?: string;
-};
-
-const pluginList = pluginsJson as PluginObj[];
+const pluginList = pluginsJson as PluginDef[];
 void ["TODO:", pluginList];
 
 async function run() {