소스 검색

feat: like & dislike hotkeys & new hotkeys category

Sv443 2 일 전
부모
커밋
6a24fabf72

+ 9 - 9
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) | `350` (default locale) |  |
-| ✅ | [`de-DE`](./de-DE.json) | `350/350` (100%) | ─ |
-|  | [`en-GB`](./en-GB.json) | `350/350` (100%) | `en-US` |
-| ⚠ | [`es-ES`](./es-ES.json) | `342/350` (97.7%) | ─ |
-| ⚠ | [`fr-FR`](./fr-FR.json) | `342/350` (97.7%) | ─ |
-| ⚠ | [`hi-IN`](./hi-IN.json) | `342/350` (97.7%) | ─ |
-| ⚠ | [`ja-JP`](./ja-JP.json) | `342/350` (97.7%) | ─ |
-| ⚠ | [`pt-BR`](./pt-BR.json) | `342/350` (97.7%) | ─ |
-| ⚠ | [`zh-CN`](./zh-CN.json) | `342/350` (97.7%) | ─ |
+|  | [`en-US`](./en-US.json) | `355` (default locale) |  |
+| ✅ | [`de-DE`](./de-DE.json) | `355/355` (100%) | ─ |
+|  | [`en-GB`](./en-GB.json) | `355/355` (100%) | `en-US` |
+| ⚠ | [`es-ES`](./es-ES.json) | `340/355` (95.8%) | ─ |
+| ⚠ | [`fr-FR`](./fr-FR.json) | `340/355` (95.8%) | ─ |
+| ⚠ | [`hi-IN`](./hi-IN.json) | `340/355` (95.8%) | ─ |
+| ⚠ | [`ja-JP`](./ja-JP.json) | `340/355` (95.8%) | ─ |
+| ⚠ | [`pt-BR`](./pt-BR.json) | `340/355` (95.8%) | ─ |
+| ⚠ | [`zh-CN`](./zh-CN.json) | `340/355` (95.8%) | ─ |
 
 <sub>
 ✅ - Fully translated

+ 13 - 7
assets/translations/de-DE.json

@@ -251,11 +251,12 @@
   "feature_category_volume": "Lautstärke",
   "feature_category_songLists": "Songlisten",
   "feature_category_behavior": "Verhalten",
-  "feature_category_input": "Eingabe",
+  "feature_category_input": "Interaktion",
+  "feature_category_hotkeys": "Hotkeys",
   "feature_category_lyrics": "Songtexte",
   "feature_category_integrations": "Integrationen",
   "feature_category_plugins": "Plugins",
-  "feature_category_general": "Allgemein",
+  "feature_category_general": "Allgemeines",
 
   "feature_desc_watermarkEnabled": "Zeige ein Wasserzeichen unter dem Seitenlogo, das dieses Einstellungsmenü öffnet",
   "feature_helptext_watermarkEnabled": "Wenn dies deaktiviert ist, kannst du das Einstellungsmenü immer noch öffnen, indem du die Option im Menü anklickst, das sich öffnet, wenn du auf dein Profilbild in der oberen rechten Ecke klickst.\nEs wird jedoch schwieriger sein, das Easter Egg zu finden ;)",
@@ -313,16 +314,14 @@
   "feature_desc_rememberSongTimeMinPlayTime": "Mindestanzahl an Sekunden, die ein Song gespielt werden muss, damit die Zeit gespeichert wird",
   "feature_desc_autoScrollToActiveSongMode": "Ob und wann zu dem aktuell spielenden Song in der Wiedergabeliste gescrollt werden soll",
 
-  "feature_desc_arrowKeySupport": "Benutze die Pfeiltasten um vor- und zurückzuspulen",
-  "feature_helptext_arrowKeySupport": "Normalerweise kannst du nur in 10 Sekunden Schritten vor- und zurückspulen, indem du die Tasten \"H\" und \"L\" benutzt. Diese Funktion ermöglicht es dir, auch die Pfeiltasten zu benutzen.\nUm die Anzahl der Sekunden zu ändern, um die gespult werden soll, benutze die Option unten.",
+  "feature_desc_arrowKeySupport": "Benutze die Pfeiltasten um vor- und zurückzuspulen und die Lautstärke zu ändern",
+  "feature_helptext_arrowKeySupport": "Normalerweise kannst du nur in 10 Sekunden Schritten vor- und zurückspulen, indem du die Tasten \"H\" und \"L\" benutzt. Diese Funktion ermöglicht es dir, die Pfeiltasten zum Spulen und Lautstärke ändern zu benutzen.\nUm die Anzahl der Sekunden zu ändern, um die gespult werden soll, benutze die Option unten.",
   "feature_desc_arrowKeySkipBy": "Um wie viele Sekunden vor- und zurückspulen, wenn die Pfeiltasten benutzt werden",
+  "feature_desc_arrowKeyVolumeStep": "Um wie viel Prozent die Lautstärke erhöhen oder verringern, wenn die Pfeiltasten benutzt werden",
   "feature_desc_frameSkip": "Mit den Tasten \"Punkt\" und \"Komma\" um einen Frame spulen, während der Song oder das Video pausiert ist",
   "feature_desc_frameSkipWhilePlaying": "Erlaube das Spulen um einen Frame auch während der Song oder das Video noch läuft",
   "feature_desc_frameSkipAmount": "Wie viele Sekunden mit den Tasten \"Punkt\" und \"Komma\" übersprungen werden sollen",
   "feature_helptext_frameSkipAmount": "Dieses Feature ist auch auf YT verfügbar und überspringt einen festen Wert von etwa 0.0417 Sekunden. Wenn nötig, kannst du hier einen anderen Wert festlegen.",
-  "feature_desc_switchBetweenSites": "Füge einen Hotkey hinzu, um zwischen den YT und YTM Seiten zu wechseln",
-  "feature_helptext_switchBetweenSites": "Wenn du auf YouTube oder YouTube Music bist, kannst du mit diesem Hotkey zur anderen Seite wechseln, während du auf demselben Video / Song bleibst.",
-  "feature_desc_switchSitesHotkey": "Welcher Hotkey muss gedrückt werden, um zwischen den Seiten zu wechseln?",
   "feature_desc_anchorImprovements": "Links auf der Seite erstellen und verbessern, damit Dinge einfacher in einem neuen Tab geöffnet werden können",
   "feature_helptext_anchorImprovements": "Einige Elemente auf der Seite sind nur mit der linken Maustaste klickbar, was bedeutet, dass du sie nicht in einem neuen Tab öffnen kannst, indem du darauf mit der mittleren Maustaste klickst oder durch das Kontextmenü mit Shift + Rechtsklick. Diese Funktion fügt Links zu vielen von ihnen hinzu oder vergrößert vorhandene, um das Klicken zu erleichtern.",
   "feature_desc_autoLikeChannels": "Automatisch alle Songs und Videos bestimmter Kanäle liken",
@@ -334,6 +333,13 @@
   "feature_desc_autoLikeOpenMgmtDialog": "Öffne den Dialog, um die auto-geliketen Kanäle zu verwalten",
   "feature_btn_autoLikeOpenMgmtDialog": "Dialog öffnen",
   "feature_btn_autoLikeOpenMgmtDialog_running": "Wird geöffnet...",
+  
+  "feature_desc_switchBetweenSites": "Füge einen Hotkey hinzu, um zwischen den YT und YTM Seiten zu wechseln",
+  "feature_helptext_switchBetweenSites": "Wenn du auf YouTube oder YouTube Music bist, kannst du mit diesem Hotkey zur anderen Seite wechseln, während du auf demselben Video / Song bleibst.",
+  "feature_desc_switchSitesHotkey": "Der Hotkey, um zwischen den Seiten zu wechseln",
+  "feature_desc_likeDislikeHotkeys": "Füge Hotkeys hinzu, um das aktuell spielende Video oder Lied zu liken oder disliken",
+  "feature_desc_likeHotkey": "Der Hotkey, um das aktuell spielende Video oder Lied zu liken",
+  "feature_desc_dislikeHotkey": "Der Hotkey, um das aktuell spielende Video oder Lied zu disliken",
 
   "feature_desc_geniusLyrics": "Füge einen Knopf zu dem aktuell spielenden Song hinzu, um den Songtext auf genius.com zu öffnen",
   "feature_desc_errorOnLyricsNotFound": "Zeige einen Error, wenn die Songtext-Seite für den aktuell spielenden Song nicht gefunden werden konnte",

+ 11 - 5
assets/translations/en-US.json

@@ -252,6 +252,7 @@
   "feature_category_songLists": "Song Lists",
   "feature_category_behavior": "Behavior",
   "feature_category_input": "Input",
+  "feature_category_hotkeys": "Hotkeys",
   "feature_category_lyrics": "Lyrics",
   "feature_category_integrations": "Integrations",
   "feature_category_plugins": "Plugins",
@@ -313,16 +314,14 @@
   "feature_desc_rememberSongTimeMinPlayTime": "Minimum amount of seconds a song needs to be played for its time to be remembered",
   "feature_desc_autoScrollToActiveSongMode": "When to scroll to the currently playing song in the queue",
 
-  "feature_desc_arrowKeySupport": "Use arrow keys to skip forwards and backwards in the currently playing song",
-  "feature_helptext_arrowKeySupport": "Normally you can only skip forwards and backwards by a fixed 10 second interval with the keys \"H\" and \"L\". This feature allows you to use the arrow keys too.\nTo change the amount of seconds to skip, use the option below.",
+  "feature_desc_arrowKeySupport": "Use arrow keys to skip forwards and backwards and to change the volume",
+  "feature_helptext_arrowKeySupport": "Normally you can only skip forwards and backwards by a fixed 10 second interval with the keys \"H\" and \"L\". This feature allows you to use the arrow keys to skip forwards and backwards and change the volume.\nTo change the amount of seconds to skip, use the option below.",
   "feature_desc_arrowKeySkipBy": "By how many seconds to skip when using the arrow keys",
+  "feature_desc_arrowKeyVolumeStep": "How many percent to increase or decrease the volume by when using the arrow keys",
   "feature_desc_frameSkip": "Use the period and comma keys to skip forwards and backwards by a frame when the video or song is paused",
   "feature_desc_frameSkipWhilePlaying": "Also allow skipping by a frame while the video or song is still playing",
   "feature_desc_frameSkipAmount": "How many seconds to skip with the period and comma keys",
   "feature_helptext_frameSkipAmount": "This same feature which is natively available on YT skips by a fixed value of about 0.0417 seconds. If needed, adjust it to a different value here.",
-  "feature_desc_switchBetweenSites": "Add a hotkey to switch between the YT and YTM sites on a video or song",
-  "feature_helptext_switchBetweenSites": "Pressing this hotkey will switch to the other site if you are on YouTube or YouTube Music while staying on the same video or song.",
-  "feature_desc_switchSitesHotkey": "Which hotkey needs to be pressed to switch sites?",
   "feature_desc_anchorImprovements": "Add and improve links all over the page so things can be opened in a new tab easier",
   "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_desc_autoLikeChannels": "Automatically like all songs and videos of certain channels",
@@ -334,6 +333,13 @@
   "feature_desc_autoLikeOpenMgmtDialog": "Open the dialog to manage auto-liked channels",
   "feature_btn_autoLikeOpenMgmtDialog": "Open dialog",
   "feature_btn_autoLikeOpenMgmtDialog_running": "Opening...",
+  
+  "feature_desc_switchBetweenSites": "Add a hotkey to switch between the YT and YTM sites on a video or song",
+  "feature_helptext_switchBetweenSites": "Pressing this hotkey will switch to the other site if you are on YouTube or YouTube Music while staying on the same video or song.",
+  "feature_desc_switchSitesHotkey": "The hotkey to switch between the sites",
+  "feature_desc_likeDislikeHotkeys": "Add hotkeys to like and dislike the currently playing video or song",
+  "feature_desc_likeHotkey": "The hotkey to like the current video or song",
+  "feature_desc_dislikeHotkey": "The hotkey to dislike the current video or song",
 
   "feature_desc_geniusLyrics": "Add a button to the media controls of the currently playing song to open its lyrics on genius.com",
   "feature_desc_errorOnLyricsNotFound": "Show an error when the lyrics page for the currently playing song couldn't be found",

+ 4 - 5
assets/translations/es-ES.json

@@ -304,16 +304,11 @@
   "feature_desc_rememberSongTimeMinPlayTime": "Cantidad mínima de segundos que una canción debe reproducirse para recordar su tiempo",
   "feature_desc_autoScrollToActiveSongMode": "¿Cuándo y si desplazarse automáticamente a la canción que se está reproduciendo actualmente?",
 
-  "feature_desc_arrowKeySupport": "Use las teclas de flecha para saltar hacia adelante y hacia atrás en la canción que se está reproduciendo actualmente",
-  "feature_helptext_arrowKeySupport": "Normalmente solo puede saltar hacia adelante y hacia atrás en un intervalo fijo de 10 segundos con las teclas \"H\" y \"L\". Esta función le permite usar las teclas de flecha también.\nPara cambiar la cantidad de segundos para saltar, use la opción a continuación.",
   "feature_desc_arrowKeySkipBy": "Por cuántos segundos saltar al usar las teclas de flecha",
   "feature_desc_frameSkip": "Utilice las teclas de punto y coma para avanzar o retroceder un cuadro cuando el video o la canción estén en pausa.",
   "feature_desc_frameSkipWhilePlaying": "Utilice las teclas de punto y coma para avanzar o retroceder un cuadro mientras el video o la canción se están reproduciendo.",
   "feature_desc_frameSkipAmount": "Cuántos segundos saltar al usar las teclas de punto y coma",
   "feature_helptext_frameSkipAmount": "Este ajuste también está disponible en YT y salta un valor fijo de aproximadamente 0.0417 segundos. Si es necesario, puede establecer otro valor aquí.",
-  "feature_desc_switchBetweenSites": "Agregue una tecla de acceso rápido para cambiar entre los sitios YT y YTM en una canción",
-  "feature_helptext_switchBetweenSites": "Al presionar esta tecla de acceso rápido, cambiará al otro sitio si está en YouTube o YouTube Music mientras se mantiene en el mismo video / canción.",
-  "feature_desc_switchSitesHotkey": "¿Qué tecla de acceso rápido debe presionarse para cambiar de sitio?",
   "feature_desc_anchorImprovements": "Agregue e improvise enlaces en toda la página para que las cosas se puedan abrir en una nueva pestaña más fácilmente",
   "feature_helptext_anchorImprovements": "Algunos elementos en la página solo se pueden hacer clic con el botón izquierdo del mouse, lo que significa que no se pueden abrir en una nueva pestaña haciendo clic con el botón central o mediante el menú contextual con shift + clic derecho. Esta función agrega enlaces a muchos de ellos o los agranda para facilitar el clic.",
   "feature_desc_autoLikeChannels": "Dar me gusta automáticamente a todas las canciones y videos de ciertos canales",
@@ -325,6 +320,10 @@
   "feature_desc_autoLikeOpenMgmtDialog": "Abrir el diálogo para administrar los canales con me gusta automático",
   "feature_btn_autoLikeOpenMgmtDialog": "Abrir diálogo",
   "feature_btn_autoLikeOpenMgmtDialog_running": "Abriendo...",
+  
+  "feature_desc_switchBetweenSites": "Agregue una tecla de acceso rápido para cambiar entre los sitios YT y YTM en una canción",
+  "feature_helptext_switchBetweenSites": "Al presionar esta tecla de acceso rápido, cambiará al otro sitio si está en YouTube o YouTube Music mientras se mantiene en el mismo video / canción.",
+  "feature_desc_switchSitesHotkey": "¿Qué tecla de acceso rápido debe presionarse para cambiar de sitio?",
 
   "feature_desc_geniusLyrics": "Agregue un botón a los controles multimedia de la canción que se está reproduciendo actualmente para abrir sus letras en genius.com",
   "feature_desc_errorOnLyricsNotFound": "Mostrar un error cuando no se pudo encontrar la página de letras para la canción que se está reproduciendo actualmente",

+ 4 - 5
assets/translations/fr-FR.json

@@ -304,16 +304,11 @@
   "feature_desc_rememberSongTimeMinPlayTime": "Temps minimum en secondes que la chanson doit être lue pour que son temps soit mémorisé",
   "feature_desc_autoScrollToActiveSongMode": "Quand et si faire défiler jusqu'à la chanson en cours de lecture",
 
-  "feature_desc_arrowKeySupport": "Utilisez les touches fléchées pour avancer et reculer dans la chanson en cours de lecture",
-  "feature_helptext_arrowKeySupport": "Normalement, vous ne pouvez avancer et reculer que par intervalles fixes de 10 secondes avec les touches \"H\" et \"L\". Cette fonctionnalité vous permet d'utiliser aussi les touches fléchées.\nPour changer le nombre de secondes à sauter, utilisez l'option ci-dessous.",
   "feature_desc_arrowKeySkipBy": "De combien de secondes sauter en utilisant les touches fléchées",
   "feature_desc_frameSkip": "Utiliser les touches virgule et point pour avancer et reculer d'une image lorsque la vidéo ou la chanson est en pause",
   "feature_desc_frameSkipWhilePlaying": "Utiliser les touches virgule et point pour avancer et reculer d'une image lorsque la vidéo ou la chanson est en cours de lecture",
   "feature_desc_frameSkipAmount": "De combien de secondes sauter avec les touches \"point\" et \"virgule\"",
   "feature_helptext_frameSkipAmount": "Cette fonctionnalité est également disponible sur YT et saute une valeur fixe d'environ 0,0417 secondes. Si nécessaire, vous pouvez définir une autre valeur ici.",
-  "feature_desc_switchBetweenSites": "Ajouter un raccourci pour passer d'un site à l'autre sur une vidéo / chanson",
-  "feature_helptext_switchBetweenSites": "En appuyant sur ce raccourci, vous passerez à l'autre site si vous êtes sur YouTube ou YouTube Music tout en restant sur la même vidéo / chanson.",
-  "feature_desc_switchSitesHotkey": "Quelle touche de raccourci doit être enfoncée pour passer d'un site à l'autre?",
   "feature_desc_anchorImprovements": "Ajouter et améliorer les liens sur toute la page pour que les choses puissent être ouvertes dans un nouvel onglet plus facilement",
   "feature_helptext_anchorImprovements": "Certains éléments de la page ne sont cliquables qu'avec le bouton gauche de la souris, ce qui signifie que vous ne pouvez pas les ouvrir dans un nouvel onglet en cliquant au milieu ou via le menu contextuel en utilisant Maj + clic droit. Cette fonctionnalité ajoute des liens à beaucoup d'entre eux ou les agrandit pour faciliter le clic.",
   "feature_desc_autoLikeChannels": "Aimer automatiquement toutes les chansons et vidéos de certaines chaînes",
@@ -325,6 +320,10 @@
   "feature_desc_autoLikeOpenMgmtDialog": "Ouvrir la boîte de dialogue pour gérer les chaînes auto-aimées",
   "feature_btn_autoLikeOpenMgmtDialog": "Ouvrir la boîte de dialogue",
   "feature_btn_autoLikeOpenMgmtDialog_running": "Ouverture...",
+  
+  "feature_desc_switchBetweenSites": "Ajouter un raccourci pour passer d'un site à l'autre sur une vidéo / chanson",
+  "feature_helptext_switchBetweenSites": "En appuyant sur ce raccourci, vous passerez à l'autre site si vous êtes sur YouTube ou YouTube Music tout en restant sur la même vidéo / chanson.",
+  "feature_desc_switchSitesHotkey": "Quelle touche de raccourci doit être enfoncée pour passer d'un site à l'autre?",
 
   "feature_desc_geniusLyrics": "Ajouter un bouton aux contrôles multimédias de la chanson en cours de lecture pour ouvrir ses paroles sur genius.com",
   "feature_desc_errorOnLyricsNotFound": "Afficher une erreur lorsque la page de paroles pour la chanson en cours de lecture n'a pas pu être trouvée",

+ 4 - 5
assets/translations/hi-IN.json

@@ -304,16 +304,11 @@
   "feature_desc_rememberSongTimeMinPlayTime": "गीत को याद रखने के लिए न्यूनतम समय (सेकंड) जिसे गीत को खेलना चाहिए",
   "feature_desc_autoScrollToActiveSongMode": "वर्तमान में चल रहे गीत में ऑटो-स्क्रॉल करने का मोड",
 
-  "feature_desc_arrowKeySupport": "वर्तमान में चल रहे गीत के मीडिया नियंत्रणों में एक बटन जो एरो कुंजियों का समर्थन करता है",
-  "feature_helptext_arrowKeySupport": "सामान्य रूप से आप केवल बाएं और दाएं तीर कुंजियों का उपयोग करके एक निश्चित 10 सेकंड के अंतराल में छोड़ सकते हैं। इस सुविधा की मदद से आप तीर कुंजियों का उपयोग कर सकते हैं।\nछोड़ने के लिए सेकंडों की मात्रा बदलने के लिए, नीचे दिए गए विकल्प का उपयोग करें।",
   "feature_desc_arrowKeySkipBy": "एरो कुंजियों का उपयोग करते समय कितने सेकंड छोड़ें",
   "feature_desc_frameSkip": "वीडियो या गीत को रोकने पर एक फ्रेम छोड़ें",
   "feature_desc_frameSkipWhilePlaying": "वीडियो या गीत को रोकने पर एक फ्रेम छोड़ें",
   "feature_desc_frameSkipAmount": "\"पीरियड\" और \"कॉमा\" कुंजियों से कितने सेकंड छोड़े जाने चाहिए",
   "feature_helptext_frameSkipAmount": "इस सुविधा को YT पर भी उपलब्ध है और यह लगभग 0.0417 सेकंड का एक निश्चित मान छोड़ता है। यदि आवश्यक हो, तो आप यहां एक अलग मान सेट कर सकते हैं।",
-  "feature_desc_switchBetweenSites": "वीडियो / गीत पर YT और YTM साइटों के बीच स्विच करने के लिए एक हॉटकी जोड़ें",
-  "feature_helptext_switchBetweenSites": "इस हॉटकी को दबाने से आप वर्तमान में चल रहे वीडियो / गीत के बीच स्विच कर सकते हैं जब आप YT या YTM पर होते हैं।",
-  "feature_desc_switchSitesHotkey": "साइटों को स्विच करने के लिए कौन सी हॉटकी दबानी चाहिए?",
   "feature_desc_anchorImprovements": "एक और बेहतर लिंक जो चीजों को एक नए टैब में खोलने के लिए आसान बनाता है",
   "feature_helptext_anchorImprovements": "पृष्ठ पर कुछ तत्व केवल बाएं माउस बटन के साथ क्लिक करके ही खोले जा सकते हैं, जिसका मतलब है कि आप उन्हें मध्य बटन क्लिक करके नए टैब में नहीं खोल सकते या तो तीन बटन क्लिक करके या तो शिफ्ट + दाएं क्लिक के माध्यम से संदर्भ मेनू के माध्यम से। यह सुविधा उनमें से बहुत से को लिंक जोड़ती है या मौजूदे को बड़ा करती है ताकि क्लिक करना आसान हो।",
   "feature_desc_autoLikeChannels": "कुछ चैनलों के सभी गानों और वीडियो को स्वचालित रूप से पसंद करें",
@@ -325,6 +320,10 @@
   "feature_desc_autoLikeOpenMgmtDialog": "स्वचालित रूप से पसंद किए गए चैनलों का प्रबंधन करने के लिए डायलॉग खोलें",
   "feature_btn_autoLikeOpenMgmtDialog": "डायलॉग खोलें",
   "feature_btn_autoLikeOpenMgmtDialog_running": "खोल रहा है...",
+  
+  "feature_desc_switchBetweenSites": "वीडियो / गीत पर YT और YTM साइटों के बीच स्विच करने के लिए एक हॉटकी जोड़ें",
+  "feature_helptext_switchBetweenSites": "इस हॉटकी को दबाने से आप वर्तमान में चल रहे वीडियो / गीत के बीच स्विच कर सकते हैं जब आप YT या YTM पर होते हैं।",
+  "feature_desc_switchSitesHotkey": "साइटों को स्विच करने के लिए कौन सी हॉटकी दबानी चाहिए?",
 
   "feature_desc_geniusLyrics": "वर्तमान में चल रहे गीत के मीडिया नियंत्रणों में एक बटन जो genius.com पर इसके बोल खोलता है",
   "feature_desc_errorOnLyricsNotFound": "वर्तमान में चल रहे गीत के लिए बोल पृष्ठ नहीं मिलने पर एक त्रुटि दिखाएं",

+ 4 - 5
assets/translations/ja-JP.json

@@ -304,16 +304,11 @@
   "feature_desc_rememberSongTimeMinPlayTime": "曲の時間を記憶するために再生する必要のある最小秒数",
   "feature_desc_autoScrollToActiveSongMode": "現在再生中の曲にスクロールするかどうか、およびそのタイミング",
 
-  "feature_desc_arrowKeySupport": "現在再生中の曲で前後にスキップするには矢印キーを使用する",
-  "feature_helptext_arrowKeySupport": "通常、キー \"H\" と \"L\" を使用して 10 秒間隔で前後にスキップすることができます。この機能を使用すると、矢印キーも使用できます。\nスキップする秒数を変更するには、以下のオプションを使用してください。",
   "feature_desc_arrowKeySkipBy": "矢印キーを使用してスキップする秒数",
   "feature_desc_frameSkip": "ビデオ / 曲を一時停止しているときに、フレーム単位で前後にスキップする",
   "feature_desc_frameSkipWhilePlaying": "ビデオ / 曲を再生しているときに、フレーム単位で前後にスキップする",
   "feature_desc_frameSkipAmount": "\"ピリオド\"と\"カンマ\"キーで何秒スキップするか",
   "feature_helptext_frameSkipAmount": "この機能は YT でも利用可能で、約 0.0417 秒の固定値をスキップします。必要に応じて、ここで別の値を設定できます。",
-  "feature_desc_switchBetweenSites": "ビデオ / 曲の YT と YTM サイトを切り替えるホットキーを追加する",
-  "feature_helptext_switchBetweenSites": "このホットキーを押すと、同じビデオ / 曲のままで YouTube または YouTube Music のどちらかに切り替わります。",
-  "feature_desc_switchSitesHotkey": "サイトを切り替えるために押す必要があるホットキーはどれですか?",
   "feature_desc_anchorImprovements": "リンクを追加してページ全体でリンクを開くことができるようにする",
   "feature_helptext_anchorImprovements": "ページ上のいくつかの要素は左クリックのみでクリックできるため、中クリックやシフト + 右クリックを使用して新しいタブで開くことができません。この機能はそれらの要素にリンクを追加するか、既存のリンクを拡大してクリックしやすくします。",
   "feature_desc_autoLikeChannels": "特定のチャンネルのすべての曲とビデオを自動的に好きにする",
@@ -325,6 +320,10 @@
   "feature_desc_autoLikeOpenMgmtDialog": "自動的に好きなチャンネルを管理するダイアログを開く",
   "feature_btn_autoLikeOpenMgmtDialog": "ダイアログを開く",
   "feature_btn_autoLikeOpenMgmtDialog_running": "開いています...",
+  
+  "feature_desc_switchBetweenSites": "ビデオ / 曲の YT と YTM サイトを切り替えるホットキーを追加する",
+  "feature_helptext_switchBetweenSites": "このホットキーを押すと、同じビデオ / 曲のままで YouTube または YouTube Music のどちらかに切り替わります。",
+  "feature_desc_switchSitesHotkey": "サイトを切り替えるために押す必要があるホットキーはどれですか?",
 
   "feature_desc_geniusLyrics": "現在再生中の曲のメディアコントロールにボタンを追加して、genius.com で歌詞を開く",
   "feature_desc_errorOnLyricsNotFound": "現在再生中の曲の歌詞ページが見つからなかった場合にエラーを表示する",

+ 4 - 5
assets/translations/pt-BR.json

@@ -304,16 +304,11 @@
   "feature_desc_rememberSongTimeMinPlayTime": "Quantidade mínima de segundos que uma música precisa ser reproduzida para que seu tempo seja lembrado",
   "feature_desc_autoScrollToActiveSongMode": "Se e quando rolar para a música que está tocando atualmente na fila",
 
-  "feature_desc_arrowKeySupport": "Use as teclas de seta para pular para a próxima ou anterior música na fila",
-  "feature_helptext_arrowKeySupport": "Normalmente, você só pode pular para frente e para trás por um intervalo fixo de 10 segundos com as teclas \"H\" e \"L\". Este recurso permite que você use as teclas de seta também.\nPara alterar a quantidade de segundos a pular, use a opção abaixo.",
   "feature_desc_arrowKeySkipBy": "Por quantos segundos pular ao usar as teclas de seta",
   "feature_desc_frameSkip": "Use as teclas de ponto e vírgula para pular para frente e para trás por um quadro quando o vídeo ou música estiver pausado",
   "feature_desc_frameSkipWhilePlaying": "Use as teclas de ponto e vírgula para pular para frente e para trás por um quadro quando o vídeo ou música estiver tocando",
   "feature_desc_frameSkipAmount": "Quantos segundos devem ser pulados com as teclas \"ponto\" e \"vírgula\"",
   "feature_helptext_frameSkipAmount": "Este recurso também está disponível no YT e pula um valor fixo de cerca de 0,0417 segundos. Se necessário, você pode definir outro valor aqui.",
-  "feature_desc_switchBetweenSites": "Adicione um atalho para alternar entre os sites YT e YTM em um vídeo / música",
-  "feature_helptext_switchBetweenSites": "Pressionar este atalho alternará para o outro site se você estiver no YouTube ou YouTube Music, mantendo-se na mesma música / vídeo.",
-  "feature_desc_switchSitesHotkey": "Qual tecla de atalho precisa ser pressionada para alternar entre os sites?",
   "feature_desc_anchorImprovements": "Adicione e melhore os links em toda a página para que as coisas possam ser abertas em uma nova guia com mais facilidade",
   "feature_helptext_anchorImprovements": "Alguns elementos na página só podem ser clicados com o botão esquerdo do mouse, o que significa que você não pode abri-los em uma nova guia clicando com o botão do meio ou através do menu de contexto usando shift + clique com o botão direito. Este recurso adiciona links a muitos deles ou os aumenta para facilitar o clique.",
   "feature_desc_autoLikeChannels": "Curtir automaticamente todas as músicas e vídeos de certos canais",
@@ -325,6 +320,10 @@
   "feature_desc_autoLikeOpenMgmtDialog": "Abrir o diálogo para gerenciar os canais auto-curtidos",
   "feature_btn_autoLikeOpenMgmtDialog": "Abrir diálogo",
   "feature_btn_autoLikeOpenMgmtDialog_running": "Abrindo...",
+  
+  "feature_desc_switchBetweenSites": "Adicione um atalho para alternar entre os sites YT e YTM em um vídeo / música",
+  "feature_helptext_switchBetweenSites": "Pressionar este atalho alternará para o outro site se você estiver no YouTube ou YouTube Music, mantendo-se na mesma música / vídeo.",
+  "feature_desc_switchSitesHotkey": "Qual tecla de atalho precisa ser pressionada para alternar entre os sites?",
 
   "feature_desc_geniusLyrics": "Adicione um botão aos controles de mídia da música que está tocando atualmente para abrir suas letras em genius.com",
   "feature_desc_errorOnLyricsNotFound": "Mostrar um erro quando a página de letras para a música que está tocando atualmente não pôde ser encontrada",

+ 5 - 6
assets/translations/zh-CN.json

@@ -304,16 +304,11 @@
   "feature_desc_rememberSongTimeMinPlayTime": "歌曲需要播放多少秒才能记住其时间",
   "feature_desc_autoScrollToActiveSongMode": "是否以及何时滚动到队列中当前播放的歌曲",
 
-  "feature_desc_arrowKeySupport": "使用箭头键在当前播放的歌曲中前进和后退",
-  "feature_helptext_arrowKeySupport": "通常,您只能使用 \"H\" 和 \"L\" 键以固定的 10 秒间隔前进和后退。此功能允许您也使用箭头键。\n要更改要跳过的秒数,请使用下面的选项。",
   "feature_desc_arrowKeySkipBy": "使用箭头键跳过多少秒",
   "feature_desc_frameSkip": "使用逗号和句号键在视频或歌曲暂停时前进和后退",
   "feature_desc_frameSkipWhilePlaying": "使用逗号和句号键在视频或歌曲播放时前进和后退",
   "feature_desc_frameSkipAmount": "在视频或歌曲暂停时使用逗号和句号键前进和后退",
   "feature_helptext_frameSkipAmount": "该功能也可在 YT 上使用,并跳过约 0.0417 秒的固定值。如果需要,您可以在此处设置不同的值。",
-  "feature_desc_switchBetweenSites": "在视频 / 歌曲上添加一个热键,以在 YT 和 YTM 网站之间切换",
-  "feature_helptext_switchBetweenSites": "按下此热键将在 YT 或 YTM 上切换到另一个站点,同时保持在同一视频 / 歌曲上。",
-  "feature_desc_switchSitesHotkey": "需要按下哪个热键才能切换网站?",
   "feature_desc_anchorImprovements": "在页面上添加和改进链接,以便更容易在新标签页中打开",
   "feature_helptext_anchorImprovements": "页面上的一些元素只能使用鼠标左键单击,这意味着您无法通过中键单击或使用 shift + 右键单击的上下文菜单在新标签页中打开它们。此功能添加了很多链接或扩大了现有的链接,以使单击更容易。",
   "feature_desc_autoLikeChannels": "自动喜欢某些频道的所有歌曲和视频",
@@ -325,7 +320,11 @@
   "feature_desc_autoLikeOpenMgmtDialog": "打开对话框以管理自动喜欢的频道",
   "feature_btn_autoLikeOpenMgmtDialog": "打开对话框",
   "feature_btn_autoLikeOpenMgmtDialog_running": "正在打开...",
-
+  
+  "feature_desc_switchBetweenSites": "在视频 / 歌曲上添加一个热键,以在 YT 和 YTM 网站之间切换",
+  "feature_helptext_switchBetweenSites": "按下此热键将在 YT 或 YTM 上切换到另一个站点,同时保持在同一视频 / 歌曲上。",
+  "feature_desc_switchSitesHotkey": "需要按下哪个热键才能切换网站?",
+  
   "feature_desc_geniusLyrics": "在当前播放的歌曲的媒体控件中添加一个按钮,以在 genius.com 上打开其歌词",
   "feature_desc_errorOnLyricsNotFound": "当找不到当前播放歌曲的歌词页面时显示一个错误",
   "feature_desc_geniUrlBase": "geniURL 实例的基本 URL,请参阅 https://github.com/Sv443/geniURL",

+ 2 - 0
src/config.ts

@@ -141,6 +141,8 @@ export const migrations: DataMigrationsDict = {
       "aboveQueueBtnsSticky", "autoScrollToActiveSongMode",
       "frameSkip", "frameSkipWhilePlaying",
       "frameSkipAmount", "watchPageFullSize",
+      "arrowKeyVolumeStep", "likeDislikeHotkeys",
+      "likeHotkey", "dislikeHotkey",
     ]), [
       { key: "lyricsCacheMaxSize", oldDefault: 2000 },
     ],

+ 116 - 0
src/features/hotkeys.ts

@@ -0,0 +1,116 @@
+import { getFeature } from "../config.js";
+import { inputIgnoreTagNames } from "./input.js";
+import { siteEvents } from "../siteEvents.js";
+import { enableDiscardBeforeUnload } from "./behavior.js";
+import { getVideoTime } from "../utils/dom.js";
+import { getDomain } from "../utils/misc.js";
+import { error, info, log, warn } from "../utils/logging.js";
+import type { Domain, HotkeyObj } from "../types.js";
+
+export async function initHotkeys() {
+  const promises: Promise<void>[] = [];
+
+  if(getFeature("likeDislikeHotkeys"))
+    promises.push(initLikeDislikeHotkeys());
+
+  if(getFeature("switchBetweenSites"))
+    promises.push(initSiteSwitch());
+
+  return await Promise.allSettled(promises);
+}
+
+function keyPressed(e: KeyboardEvent, hk: HotkeyObj) {
+  return e.code === hk.code && e.shiftKey === hk.shift && e.ctrlKey === hk.ctrl && e.altKey === hk.alt;
+}
+
+//#region site switch
+
+/** switch sites only if current video time is greater than this value */
+const videoTimeThreshold = 3;
+let siteSwitchEnabled = true;
+
+/** Initializes the site switch feature */
+export async function initSiteSwitch() {
+  const domain = getDomain();
+  document.addEventListener("keydown", (e) => {
+    if(!getFeature("switchBetweenSites"))
+      return;
+    if(inputIgnoreTagNames.includes(document.activeElement?.tagName ?? ""))
+      return;
+    if(siteSwitchEnabled && keyPressed(e, getFeature("switchSitesHotkey")))
+      switchSite(domain === "yt" ? "ytm" : "yt");
+  });
+  siteEvents.on("hotkeyInputActive", (state) => {
+    if(!getFeature("switchBetweenSites"))
+      return;
+    siteSwitchEnabled = !state;
+  });
+  log("Initialized site switch listener");
+}
+
+/** Switches to the other site (between YT and YTM) */
+async function switchSite(newDomain: Domain) {
+  try {
+    if(!(["/watch", "/playlist"].some(v => location.pathname.startsWith(v))))
+      return warn("Not on a supported page, so the site switch is ignored");
+
+    let subdomain;
+    if(newDomain === "ytm")
+      subdomain = "music";
+    else if(newDomain === "yt")
+      subdomain = "www";
+
+    if(!subdomain)
+      throw new Error(`Unrecognized domain '${newDomain}'`);
+
+    enableDiscardBeforeUnload();
+
+    const { pathname, search, hash } = new URL(location.href);
+
+    const vt = await getVideoTime(0);
+
+    log(`Found video time of ${vt} seconds`);
+
+    const cleanSearch = search.split("&")
+      .filter((param) => !param.match(/^\??(t|time_continue)=/))
+      .join("&");
+
+    const newSearch = typeof vt === "number" && vt > videoTimeThreshold ?
+      cleanSearch.includes("?")
+        ? `${cleanSearch.startsWith("?")
+          ? cleanSearch
+          : "?" + cleanSearch
+        }&time_continue=${vt}`
+        : `?time_continue=${vt}`
+      : cleanSearch;
+    const newUrl = `https://${subdomain}.youtube.com${pathname}${newSearch}${hash}`;
+
+    info(`Switching to domain '${newDomain}' at ${newUrl}`);
+    location.assign(newUrl);
+  }
+  catch(err) {
+    error("Error while switching site:", err);
+  }
+}
+
+//#region like/dislike
+
+async function initLikeDislikeHotkeys() {
+  document.addEventListener("keydown", (e) => {
+    if(!getFeature("likeDislikeHotkeys"))
+      return;
+    if(inputIgnoreTagNames.includes(document.activeElement?.tagName ?? ""))
+      return;
+
+    if(keyPressed(e, getFeature("likeHotkey"))) {
+      const likeRendererEl = document.querySelector<HTMLElement>(".middle-controls-buttons ytmusic-like-button-renderer");
+      const likeBtnEl = likeRendererEl?.querySelector<HTMLButtonElement>("#button-shape-like button");
+      likeBtnEl?.click();
+    }
+    else if(keyPressed(e, getFeature("dislikeHotkey"))) {
+      const dislikeRendererEl = document.querySelector<HTMLElement>(".middle-controls-buttons ytmusic-like-button-renderer");
+      const dislikeBtnEl = dislikeRendererEl?.querySelector<HTMLButtonElement>("#button-shape-dislike button");
+      dislikeBtnEl?.click();
+    }
+  });
+}

+ 65 - 19
src/features/index.ts

@@ -18,6 +18,7 @@ import { getPluginListDialog } from "../dialogs/pluginList.js";
 export * from "./layout.js";
 export * from "./behavior.js";
 export * from "./input.js";
+export * from "./hotkeys.js";
 export * from "./integrations.js";
 export * from "./lyrics.js";
 export * from "./lyricsCache.js";
@@ -513,6 +514,17 @@ export const featInfo = {
     reloadRequired: false,
     enable: noop,
   },
+  arrowKeyVolumeStep: {
+    type: "slider",
+    category: "input",
+    min: 1,
+    max: 25,
+    step: 1,
+    default: 2,
+    unit: "%",
+    reloadRequired: false,
+    enable: noop,
+  },
   frameSkip: {
     type: "toggle",
     category: "input",
@@ -541,25 +553,6 @@ export const featInfo = {
     advanced: true,
     textAdornment: adornments.advanced,
   },
-  switchBetweenSites: {
-    type: "toggle",
-    category: "input",
-    default: true,
-    reloadRequired: false,
-    enable: noop,
-  },
-  switchSitesHotkey: {
-    type: "hotkey",
-    category: "input",
-    default: {
-      code: "F9",
-      shift: false,
-      ctrl: false,
-      alt: false,
-    },
-    reloadRequired: false,
-    enable: noop,
-  },
   anchorImprovements: {
     type: "toggle",
     category: "input",
@@ -623,6 +616,59 @@ export const featInfo = {
     click: () => getAutoLikeDialog().then(d => d.open()),
   },
 
+  //#region cat:hotkeys
+
+  switchBetweenSites: {
+    type: "toggle",
+    category: "hotkeys",
+    default: true,
+    reloadRequired: false,
+    enable: noop,
+  },
+  switchSitesHotkey: {
+    type: "hotkey",
+    category: "hotkeys",
+    default: {
+      code: "F9",
+      shift: false,
+      ctrl: false,
+      alt: false,
+    },
+    reloadRequired: false,
+    enable: noop,
+  },
+  likeDislikeHotkeys: {
+    type: "toggle",
+    category: "hotkeys",
+    default: true,
+    reloadRequired: false,
+    enable: noop,
+  },
+  likeHotkey: {
+    type: "hotkey",
+    category: "hotkeys",
+    default: {
+      code: "KeyL",
+      shift: false,
+      ctrl: false,
+      alt: true,
+    },
+    reloadRequired: false,
+    enable: noop,
+  },
+  dislikeHotkey: {
+    type: "hotkey",
+    category: "hotkeys",
+    default: {
+      code: "KeyL",
+      shift: false,
+      ctrl: true,
+      alt: true,
+    },
+    reloadRequired: false,
+    enable: noop,
+  },
+
   //#region cat:lyrics
   geniusLyrics: {
     type: "toggle",

+ 5 - 3
src/index.ts

@@ -26,8 +26,10 @@ import {
   initAutoScrollToActiveSong,
   // input category:
   initArrowKeySkip, initFrameSkip,
-  initSiteSwitch, addAnchorImprovements,
-  initNumKeysSkip, initAutoLike,
+  addAnchorImprovements, initNumKeysSkip,
+  initAutoLike,
+  // hotkeys category:
+  initHotkeys,
   // lyrics category:
   addPlayerBarLyricsBtn, initLyricsCache,
   // integrations category:
@@ -284,7 +286,7 @@ async function onDomLoad() {
 
       //#region (ytm+yt) input
 
-      ftInit.push(["siteSwitch", initSiteSwitch(domain)]);
+      ftInit.push(["hotkeys", initHotkeys()]);
 
       if(feats.autoLikeChannels)
         ftInit.push(["autoLikeChannels", initAutoLike()]);

+ 15 - 4
src/tools/tr-progress.ts

@@ -11,10 +11,18 @@ const { exit } = process;
 const rootDir = resolve(fileURLToPath(import.meta.url), "../../../");
 const trDir = join(rootDir, "assets/translations/");
 
+/** Translation metadata object */
+type TrMeta = {
+  base: string | undefined;
+  langName: string;
+  langNameEnglish: string;
+  countryName: string;
+  authors: string[];
+};
+
+/** Translation file object, containing translations and the meta object */
 type TrFile = TrObject & {
-  meta: {
-    base: string | undefined;
-  };
+  meta: TrMeta;
 }
 
 async function run() {
@@ -22,8 +30,10 @@ async function run() {
 
   //#region parse
 
-  const translations = {} as Record<TrLocale, TrObject>;
+  /** Map of locale key to translation file object. Contains everything including the `meta` object. */
   const trFiles = {} as Record<TrLocale, TrFile>;
+  /** Map of locale key to translation object. Doesn't contain the `meta` object. */
+  const translations = {} as Record<TrLocale, TrObject>;
 
   for(const locale of Object.keys(locales) as TrLocale[]) {
     const trFile = join(trDir, `${locale}.json`);
@@ -88,6 +98,7 @@ async function run() {
   const missingKeys = [] as string[];
 
   for(const [locale] of Object.entries({ "en-US": enUS, ...restLocs })) {
+    const loc = locale as TrLocale;
     const lines = [] as string[];
     // TODO:FIXME: recurse over nested objects to extract keys & turn into dot notation
     // for(const [k] of Object.entries(enUS)) {

+ 17 - 6
src/types.ts

@@ -400,6 +400,7 @@ export type FeatureCategory =
   | "songLists"
   | "behavior"
   | "input"
+  | "hotkeys"
   | "lyrics"
   | "integrations"
   | "plugins"
@@ -588,20 +589,18 @@ export interface FeatureConfig {
   autoScrollToActiveSongMode: "never" | "initialPageLoad" | "videoChangeAll" | "videoChangeManual" | "videoChangeAuto";
 
   //#region input
-  /** Arrow keys skip forwards and backwards */
+  /** Arrow keys to skip forwards and backwards and change volume */
   arrowKeySupport: boolean;
-  /** By how many seconds to skip when pressing the arrow keys */
+  /** By how many seconds to skip when pressing the left/right arrow keys */
   arrowKeySkipBy: number;
+  /** By how much to change the volume when pressing the up/down arrow keys */
+  arrowKeyVolumeStep: number;
   /** Use . and , keys to skip by a frame while the video is paused */
   frameSkip: boolean;
   /** Allow frame skipping while the song is playing */
   frameSkipWhilePlaying: boolean;
   /** Amount of seconds to skip when pressing the . and , keys */
   frameSkipAmount: number;
-  /** Add a hotkey to switch between the YT and YTM sites on a video / song */
-  switchBetweenSites: boolean;
-  /** The hotkey that needs to be pressed to initiate the site switch */
-  switchSitesHotkey: HotkeyObj;
   /** Make it so middle clicking a song to open it in a new tab (through thumbnail and song title) is easier */
   anchorImprovements: boolean;
   /** Whether to auto-like all played videos of configured channels */
@@ -618,6 +617,18 @@ export interface FeatureConfig {
   /** Opens the auto-like channels management dialog */
   autoLikeOpenMgmtDialog: undefined;
 
+  //#region hotkeys
+  /** Add a hotkey to switch between the YT and YTM sites on a video / song */
+  switchBetweenSites: boolean;
+  /** The hotkey that needs to be pressed to initiate the site switch */
+  switchSitesHotkey: HotkeyObj;
+  /** Add hotkeys for liking and disliking the current video / song */
+  likeDislikeHotkeys: boolean;
+  /** The hotkey that needs to be pressed to like the current video / song */
+  likeHotkey: HotkeyObj;
+  /** The hotkey that needs to be pressed to dislike the current video / song */
+  dislikeHotkey: HotkeyObj;
+
   //#region lyrics
   /** Add a button to the media controls to open the current song's lyrics on genius.com in a new tab */
   geniusLyrics: boolean;