Преглед на файлове

feat: update german translation

Sv443 преди 5 месеца
родител
ревизия
64c6332744
променени са 3 файла, в които са добавени 52 реда и са изтрити 34 реда
  1. 46 22
      assets/README.md
  2. 1 11
      assets/translations/README.md
  3. 5 1
      assets/translations/de-DE.json

+ 46 - 22
assets/README.md

@@ -3,16 +3,18 @@
 <br>
 
 ### Images:
-- PNG images and external assets are stored in `assets/images`
-- SVG images are stored in `assets/icons`
-- CSS files in `assets/style`
-- Translations are in `assets/translations`
+- Own PNG/JPG/GIF images are stored in [`assets/images`](./images)
+- External images are stored in [`assets/images/external`](./images/external)
+- The BYTM logo files are in [`assets/images/logo`](./images/logo)
+- SVG icons are stored in [`assets/icons`](./icons)
+- CSS stylesheets are in [`assets/style`](./style)
+- Translations are in [`assets/translations`](./translations)
 
 <br>
 
 ## JSON file formats:
 > [!NOTE]  
-> Note: If a property is wrapped with square brackets (`[name]`), it means that the property is optional
+> Note: If a property is followed by a question mark, that means it is optional
 
 <br>
 
@@ -31,29 +33,51 @@ The keys of the object are the locale codes, and the values are the locale objec
 <br>
 
 ### [`plugins.json`](plugins.json)
-(Not fully implemented yet, but should still be filled out when a plugin is added)  
+(Not implemented yet. As soon as a plugin is added, this needs to be fleshed out)  
   
-For the structure of this array of objects, see `type PluginObj` in [`src/types.ts`](../src/types.ts)
+<!-- TODO: For the structure of this array of objects, see `type PluginObj` in [`src/types.ts`](../src/types.ts) -->
+
+<br>
+
+### [`resources.json`](resources.json)
+This file contains the resources that are loaded into the runtime through the `@resource` userscript directive.  
+That includes all icons, images, CSS files, fonts, translations and other assets.  
+  
+Inside the file is an object, whose keys are the resource names and the values are the path to the resource or a configuration object.  
+The path to the resource can be relative, in which case it's resolved relative to the `assets` directory.  
+If it starts with a slash, it will be resolved relative to the project root (where `package.json` is).  
+  
+All values will be run through the function `resolveResourceVal()` in [`src/tools/post-build.ts`](./src/tools/post-build.ts) to replace placeholders with dynamic values.  
+For example, `$BRANCH` will be replaced with the branch name. Find all possible replacements in that function's declaration.  
+  
+The configuration object can have the following properties:
+| Property | Type     | Description              |
+| :------- | :------- | :----------------------- |
+| `path`   | `string` | The path to the resource |
+| `ref?`   | `string` | The GitHub ref to use for the resource, e.g. `main`, a Git tag like `v2.0.0` or a commit hash - defaults to the branch resolved in [`src/tools/post-build.ts`](./src/tools/post-build.ts) |
 
 <br>
 
 ### [`require.json`](require.json)
 This file contains the npm libraries that are loaded into the runtime through the `@require` userscript directive.  
-It's an array of objects, which each have one of the following sets of properties:  
+This is done to massively reduce the bundle size and make use of the userscript extension's caching.  
+Each library will be set as an external in the [Rollup configuration](../rollup.config.js) to prevent it from including it in the bundle.  
+The version of each package will be inferred from [`package.json`](../package.json) to ensure consistent versions across the project.  
   
-Using npm and a CDN:
-| Property    | Type      | Description                                                                           |
-| :---------- | :-------- | :------------------------------------------------------------------------------------ |
-| `pkgName`   | `string`  | The name of the npm package, as in `npm i <pkgName>`                                  |
-| `path`      | `string`  | The path to the file that should be loaded, relative to the library root dir          |
-| `global`    | `string`  | The name of the global variable that the library exports                              |
-| `[baseUrl]` | `string`  | Base URL of the CDN to use - `https://cdn.jsdelivr.net/npm/` by default               |
-| `[link]`    | `boolean` | Whether `npm link` is active and the library should instead be included in the bundle |
-
+Inside the file is an array of objects, which each have one of the following properties:  
+  
+Using npm packages through a CDN:
+| Property   | Type      | Description                                                                         |
+| :--------- | :-------- | :---------------------------------------------------------------------------------- |
+| `pkgName`  | `string`  | The name of the npm package, as in `npm i <pkgName>`                                |
+| `path`     | `string`  | The path to the file that should be loaded, relative to the library root dir        |
+| `global`   | `string`  | The name of the global variable that the library exports                            |
+| `baseUrl?` | `string`  | Base URL of the CDN to use - `https://cdn.jsdelivr.net/npm/` by default - package will be appended as `pkgName@versionFromPkgJson` |
+| `link?`    | `boolean` | Whether `npm link` is active and the library should be force-included in the bundle |
 
 Using a direct URL:
-| Property | Type      | Description                                                                           |
-| :------- | :-------- | :------------------------------------------------------------------------------------ |
-| `url`    | `string`  | URL to the file to include                                                            |
-| `global` | `string`  | The name of the global variable that the library exports                              |
-| `[link]` | `boolean` | Whether `npm link` is active and the library should instead be included in the bundle |
+| Property | Type      | Description                                                                         |
+| :------- | :-------- | :---------------------------------------------------------------------------------- |
+| `url`    | `string`  | URL to the file to include                                                          |
+| `global` | `string`  | The name of the global variable that the library exports                            |
+| `link?`  | `boolean` | Whether `npm link` is active and the library should be force-included in the bundle |

+ 1 - 11
assets/translations/README.md

@@ -17,7 +17,7 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 | &nbsp; | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
 |  | [`en-US`](./en-US.json) | `328` (default locale) |  |
-| ⚠ | [`de-DE`](./de-DE.json) | `325/328` (99.1%) | ─ |
+| ✅ | [`de-DE`](./de-DE.json) | `328/328` (100%) | ─ |
 |  | [`en-GB`](./en-GB.json) | `328/328` (100%) | `en-US` |
 | ⚠ | [`es-ES`](./es-ES.json) | `322/328` (98.2%) | ─ |
 | ⚠ | [`fr-FR`](./fr-FR.json) | `322/328` (98.2%) | ─ |
@@ -45,16 +45,6 @@ This means to figure out which keys are untranslated, you will need to manually
 
 ### Missing keys:
 
-<details><summary><code>de-DE</code> - 3 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` |
-
-<br></details>
-
 <details><summary><code>es-ES</code> - 6 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |

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

@@ -32,6 +32,7 @@
     "import_success": "Die Daten wurden erfolgreich importiert",
     "import_success_confirm_reload": "Die Daten wurden erfolgreich importiert.\nMöchtest du die Seite jetzt neu laden, um die Änderungen anzuwenden?",
     "reset_config_confirm": "Möchtest du wirklich alle Einstellungen auf ihre Standardwerte zurücksetzen?\nDie Seite wird automatisch neu geladen.",
+    "reset_everything_confirm": "Möchtest du wirklich alle gespeicherten Daten auf die Standardwerte zurücksetzen?\nDie Seite wird automatisch neu geladen.",
     "copy": "Kopieren",
     "copy_to_clipboard": "In die Zwischenablage kopieren",
     "copy_to_clipboard_error": "Der Text konnte nicht in die Zwischenablage kopiert werden. Bitte kopiere ihn hier manuell:\n%1",
@@ -70,7 +71,7 @@
     "scroll_to_bottom": "Zum Ende der Wiedergabeliste scrollen",
     "volume_tooltip": "Lautstärke: %1% (Sensitivität: %2%)",
     "volume_shared_tooltip": "Lautstärke wird zwischen allen Tabs geteilt - deaktivieren in den Einstellungen",
-    "middle_click_open_tab": "Mittelklick um in einem neuen Tab zu öffnen",
+    "middle_click_open_tab": "Mittel-Klick um in einem neuen Tab zu öffnen",
     "example_toast": "Beispiel-Toast",
     "generic_error_toast_encountered_error_type": "%1 ist aufgetreten",
     "generic_error_toast_click_for_details": "Klicke für Details",
@@ -86,6 +87,8 @@
     "advanced_mode_short": "Erweit.",
     "experimental_feature": "Experimentelle Funktion",
 
+    "open_current_lyrics": "Songtext des aktuellen Songs öffnen - Shift-Klick, um in einem neuen Fenster zu öffnen oder Strg-Klick, um manuell zu suchen",
+    "open_lyrics": "Songtext in einem neuen Tab öffnen - Strg-Klick, um manuell zu suchen",
     "open_lyrics_search_prompt": "Gib den Songtitel und den Künstler ein, um nach dem Songtext zu suchen:",
     "lyrics_loading": "Songtext-URL wird geladen...",
     "lyrics_rate_limited-1": "Du hast zu viele Anfragen gesendet.\nBitte warte ein paar Sekunden, bevor du weitere Songtexte anforderst.",
@@ -329,6 +332,7 @@
     "feature_helptext_themeSongIntegration": "Wenn das ThemeSong Addon installiert ist, aber dieses Feature deaktiviert ist (oder umgekehrt), könntest du kaputtes Styling auf der Seite bemerken.\n\nBitte stelle immer sicher, dass dieses Feature reflektiert, ob das Addon installiert ist oder nicht!",
     "feature_desc_themeSongLightness": "Wie hell die Akzentfarben sein sollen, die vom aktuellen ThemeSong-Theme abgeleitet werden",
     "feature_helptext_themeSongLightness": "Je nach den Einstellungen, die du für das ThemeSong Addon gewählt hast, ermöglicht dir dieses Feature, die Helligkeit der Akzentfarben anzupassen, die vom aktuellen Theme abgeleitet werden.\n\nDieses Feature hat keinen Effekt, wenn das ThemeSong Addon nicht installiert ist.",
+
     "feature_desc_openPluginList": "Öffne die Liste der installierten Plugins",
     "feature_btn_openPluginList": "Liste öffnen",
     "feature_btn_openPluginList_running": "Wird geöffnet...",