From ca3a0b15089a66b744be3eb056af7da5017a2597 Mon Sep 17 00:00:00 2001 From: ingo Date: Sun, 20 Sep 2026 12:35:39 +0200 Subject: [PATCH] Added new languages and modified the help key which is F1 now --- .gitignore | 1 + app/tui_app.py | 2 +- i18n/da/help.md | 15 +++++++++++++++ i18n/da/strings.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ i18n/es/help.md | 15 +++++++++++++++ i18n/es/strings.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ i18n/fr/help.md | 15 +++++++++++++++ i18n/fr/strings.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ i18n/it/help.md | 15 +++++++++++++++ i18n/it/strings.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ main.py | 4 ++++ 11 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 i18n/da/help.md create mode 100644 i18n/da/strings.json create mode 100644 i18n/es/help.md create mode 100644 i18n/es/strings.json create mode 100644 i18n/fr/help.md create mode 100644 i18n/fr/strings.json create mode 100644 i18n/it/help.md create mode 100644 i18n/it/strings.json diff --git a/.gitignore b/.gitignore index f6dd14a..333303e 100644 --- a/.gitignore +++ b/.gitignore @@ -118,6 +118,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +.build-venv-pex/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/app/tui_app.py b/app/tui_app.py index 3ead6ad..3066127 100644 --- a/app/tui_app.py +++ b/app/tui_app.py @@ -34,7 +34,7 @@ class DownloadManagerApp(App[None]): # ctrl+a "select all") has focus. BINDINGS = [ Binding("ctrl+t", "switch_language", "Language", priority=True), - Binding("ctrl+a", "show_help", "Help", priority=True), + Binding("f1", "show_help", "Help", priority=True), ] def __init__(self) -> None: diff --git a/i18n/da/help.md b/i18n/da/help.md new file mode 100644 index 0000000..6133035 --- /dev/null +++ b/i18n/da/help.md @@ -0,0 +1,15 @@ +# yt-dlp-downloadmanager - Hjælp + +1. Indtast filmens URL i feltet **URL**. +2. Indtast navnet på destinationsfilen i feltet **Navn**. Du kan angive en + sti; hvis du ikke gør det, gemmes filen i den aktuelle mappe. +3. Klik på **Vælg dele** for at hente de tilgængelige formater for URL'en. + Hvis filmen tilbyder separate lyd- og videostreams, bliver du bedt om at + vælge en lyddel og derefter en videodel. Ellers skal du kun vælge én + kombineret del. +4. Når et valg er foretaget, viser linjerne **Lyd** og/eller **Video** på + hovedskærmen, hvad der blev valgt. Klik på **Start download** for at + downloade de valgte dele. +5. Hvis lyd og video blev downloadet separat, flettes de automatisk til + destinationsfilen, når begge downloads er færdige. +6. Klik på **Afslut** for at lukke programmet. diff --git a/i18n/da/strings.json b/i18n/da/strings.json new file mode 100644 index 0000000..e701de1 --- /dev/null +++ b/i18n/da/strings.json @@ -0,0 +1,44 @@ +{ + "app.title": "yt-dlp-downloadmanager", + "label.url": "URL", + "label.name": "Navn", + "label.audio": "Lyd", + "label.video": "Video", + "label.audio_video": "Lyd + Video", + "label.none": "-", + "placeholder.url": "https://...", + "placeholder.name": "navn på destinationsfil", + "status.idle": "Inaktiv", + "status.fetching": "Henter oplysninger...", + "status.merging": "Fletter lyd og video...", + "status.done": "Færdig", + "status.progress": "{title} - {kind} - {percent:.0f}%", + "button.select_parts": "Vælg dele", + "button.start_download": "Start download", + "button.exit": "Afslut", + "button.ok": "OK", + "button.cancel": "Annuller", + "button.close": "Luk", + "dialog.error_title": "Fejl", + "dialog.select_audio": "Vælg lydspor", + "dialog.select_video": "Vælg videospor", + "dialog.select_language": "Vælg sprog", + "dialog.help_title": "Hjælp", + "dialog.help_missing": "Der er ingen hjælp tilgængelig.", + "keybind.language": "Sprog", + "keybind.help": "Hjælp", + "table.format_id": "Format-ID", + "table.resolution": "Opløsning", + "table.acodec": "Lydcodec", + "table.vcodec": "Videocodec", + "table.format": "Format", + "error.empty_url": "Indtast en URL.", + "error.empty_destination": "Indtast et destinationsnavn.", + "error.nothing_selected": "Vælg dele, før du downloader.", + "error.no_formats": "Der blev ikke fundet nogen downloadbare formater for denne URL.", + "error.no_audio_selected": "Der blev ikke valgt nogen gyldig lyddel.", + "error.no_video_selected": "Der blev ikke valgt nogen gyldig videodel.", + "error.fetch_failed": "Kunne ikke læse filmoplysninger:\n{error}", + "error.download_failed": "Download mislykkedes:\n{error}", + "error.merge_failed": "Fletning af lyd og video mislykkedes:\n{error}" +} diff --git a/i18n/es/help.md b/i18n/es/help.md new file mode 100644 index 0000000..300ec16 --- /dev/null +++ b/i18n/es/help.md @@ -0,0 +1,15 @@ +# Gestor de descargas de yt-dlp - Ayuda + +1. Introduce la URL del vídeo en el campo **URL**. +2. Introduce el nombre del archivo de destino en el campo **Nombre**. Puedes + incluir una ruta; si no lo haces, el archivo se guarda en el directorio actual. +3. Haz clic en **Seleccionar partes** para obtener los formatos disponibles para la + URL. Si el vídeo ofrece flujos de audio y vídeo separados, se te pedirá que + selecciones una parte de audio y después una parte de vídeo. De lo contrario, + solo tendrás que seleccionar una parte combinada. +4. Una vez realizada la selección, las líneas **Audio** y/o **Vídeo** de la + pantalla principal muestran lo que se ha seleccionado. Haz clic en + **Iniciar descarga** para descargar las partes seleccionadas. +5. Si el audio y el vídeo se han descargado por separado, se combinan + automáticamente en el archivo de destino una vez finalizadas ambas descargas. +6. Haz clic en **Salir** para cerrar la aplicación. diff --git a/i18n/es/strings.json b/i18n/es/strings.json new file mode 100644 index 0000000..93281a7 --- /dev/null +++ b/i18n/es/strings.json @@ -0,0 +1,44 @@ +{ + "app.title": "Gestor de descargas de yt-dlp", + "label.url": "URL", + "label.name": "Nombre", + "label.audio": "Audio", + "label.video": "Vídeo", + "label.audio_video": "Audio + Vídeo", + "label.none": "-", + "placeholder.url": "https://...", + "placeholder.name": "nombre del archivo de destino", + "status.idle": "Inactivo", + "status.fetching": "Obteniendo información...", + "status.merging": "Combinando audio y vídeo...", + "status.done": "Completado", + "status.progress": "{title} - {kind} - {percent:.0f}%", + "button.select_parts": "Seleccionar partes", + "button.start_download": "Iniciar descarga", + "button.exit": "Salir", + "button.ok": "Aceptar", + "button.cancel": "Cancelar", + "button.close": "Cerrar", + "dialog.error_title": "Error", + "dialog.select_audio": "Seleccionar parte de audio", + "dialog.select_video": "Seleccionar parte de vídeo", + "dialog.select_language": "Seleccionar idioma", + "dialog.help_title": "Ayuda", + "dialog.help_missing": "No hay ayuda disponible.", + "keybind.language": "Idioma", + "keybind.help": "Ayuda", + "table.format_id": "ID de formato", + "table.resolution": "Resolución", + "table.acodec": "Códec de audio", + "table.vcodec": "Códec de vídeo", + "table.format": "Formato", + "error.empty_url": "Introduce una URL.", + "error.empty_destination": "Introduce un nombre de destino.", + "error.nothing_selected": "Selecciona las partes antes de descargar.", + "error.no_formats": "No se encontraron formatos descargables para esta URL.", + "error.no_audio_selected": "No se seleccionó ninguna parte de audio válida.", + "error.no_video_selected": "No se seleccionó ninguna parte de vídeo válida.", + "error.fetch_failed": "No se pudo leer la información del vídeo:\n{error}", + "error.download_failed": "La descarga ha fallado:\n{error}", + "error.merge_failed": "La combinación de audio y vídeo ha fallado:\n{error}" +} diff --git a/i18n/fr/help.md b/i18n/fr/help.md new file mode 100644 index 0000000..12dc0e2 --- /dev/null +++ b/i18n/fr/help.md @@ -0,0 +1,15 @@ +# Gestionnaire de téléchargements yt-dlp - Aide + +1. Saisissez l'URL du film dans le champ **URL**. +2. Saisissez le nom du fichier de destination dans le champ **Nom**. Vous pouvez + inclure un chemin ; sinon, le fichier est enregistré dans le répertoire courant. +3. Cliquez sur **Sélectionner les parties** pour récupérer les formats disponibles + pour l'URL. Si le film propose des flux audio et vidéo séparés, vous devrez + sélectionner une partie audio, puis une partie vidéo. Sinon, vous ne sélectionnez + qu'une seule partie combinée. +4. Une fois une sélection effectuée, les lignes **Audio** et/ou **Vidéo** de + l'écran principal indiquent ce qui a été sélectionné. Cliquez sur + **Démarrer le téléchargement** pour télécharger la ou les parties sélectionnées. +5. Si l'audio et la vidéo ont été téléchargés séparément, ils sont automatiquement + fusionnés dans le fichier de destination une fois les deux téléchargements terminés. +6. Cliquez sur **Quitter** pour fermer l'application. diff --git a/i18n/fr/strings.json b/i18n/fr/strings.json new file mode 100644 index 0000000..5a65f55 --- /dev/null +++ b/i18n/fr/strings.json @@ -0,0 +1,44 @@ +{ + "app.title": "Gestionnaire de téléchargements yt-dlp", + "label.url": "URL", + "label.name": "Nom", + "label.audio": "Audio", + "label.video": "Vidéo", + "label.audio_video": "Audio + Vidéo", + "label.none": "-", + "placeholder.url": "https://...", + "placeholder.name": "nom du fichier de destination", + "status.idle": "Inactif", + "status.fetching": "Récupération des informations...", + "status.merging": "Fusion de l'audio et de la vidéo...", + "status.done": "Terminé", + "status.progress": "{title} - {kind} - {percent:.0f}%", + "button.select_parts": "Sélectionner les parties", + "button.start_download": "Démarrer le téléchargement", + "button.exit": "Quitter", + "button.ok": "OK", + "button.cancel": "Annuler", + "button.close": "Fermer", + "dialog.error_title": "Erreur", + "dialog.select_audio": "Sélectionner la partie audio", + "dialog.select_video": "Sélectionner la partie vidéo", + "dialog.select_language": "Sélectionner la langue", + "dialog.help_title": "Aide", + "dialog.help_missing": "Aucune aide n'est disponible.", + "keybind.language": "Langue", + "keybind.help": "Aide", + "table.format_id": "ID du format", + "table.resolution": "Résolution", + "table.acodec": "Codec audio", + "table.vcodec": "Codec vidéo", + "table.format": "Format", + "error.empty_url": "Veuillez saisir une URL.", + "error.empty_destination": "Veuillez saisir un nom de destination.", + "error.nothing_selected": "Veuillez sélectionner les parties avant de télécharger.", + "error.no_formats": "Aucun format téléchargeable n'a été trouvé pour cette URL.", + "error.no_audio_selected": "Aucune partie audio valide n'a été sélectionnée.", + "error.no_video_selected": "Aucune partie vidéo valide n'a été sélectionnée.", + "error.fetch_failed": "Impossible de lire les informations du film :\n{error}", + "error.download_failed": "Échec du téléchargement :\n{error}", + "error.merge_failed": "Échec de la fusion de l'audio et de la vidéo :\n{error}" +} diff --git a/i18n/it/help.md b/i18n/it/help.md new file mode 100644 index 0000000..3e21558 --- /dev/null +++ b/i18n/it/help.md @@ -0,0 +1,15 @@ +# Gestore dei download yt-dlp - Aiuto + +1. Inserisci l'URL del film nel campo **URL**. +2. Inserisci il nome del file di destinazione nel campo **Nome**. Puoi includere + un percorso; in caso contrario, il file viene salvato nella directory corrente. +3. Fai clic su **Seleziona parti** per recuperare i formati disponibili per l'URL. + Se il film offre flussi audio e video separati, ti verrà chiesto di selezionare + una parte audio e poi una parte video. Altrimenti dovrai selezionare una sola + parte combinata. +4. Dopo aver effettuato una selezione, le righe **Audio** e/o **Video** nella + schermata principale mostrano ciò che è stato selezionato. Fai clic su + **Avvia download** per scaricare le parti selezionate. +5. Se audio e video sono stati scaricati separatamente, vengono uniti + automaticamente nel file di destinazione una volta completati entrambi i download. +6. Fai clic su **Esci** per chiudere l'applicazione. diff --git a/i18n/it/strings.json b/i18n/it/strings.json new file mode 100644 index 0000000..eda6c9b --- /dev/null +++ b/i18n/it/strings.json @@ -0,0 +1,44 @@ +{ + "app.title": "Gestore dei download yt-dlp", + "label.url": "URL", + "label.name": "Nome", + "label.audio": "Audio", + "label.video": "Video", + "label.audio_video": "Audio + Video", + "label.none": "-", + "placeholder.url": "https://...", + "placeholder.name": "nome del file di destinazione", + "status.idle": "Inattivo", + "status.fetching": "Recupero delle informazioni...", + "status.merging": "Unione di audio e video...", + "status.done": "Completato", + "status.progress": "{title} - {kind} - {percent:.0f}%", + "button.select_parts": "Seleziona parti", + "button.start_download": "Avvia download", + "button.exit": "Esci", + "button.ok": "OK", + "button.cancel": "Annulla", + "button.close": "Chiudi", + "dialog.error_title": "Errore", + "dialog.select_audio": "Seleziona parte audio", + "dialog.select_video": "Seleziona parte video", + "dialog.select_language": "Seleziona lingua", + "dialog.help_title": "Aiuto", + "dialog.help_missing": "Nessun aiuto disponibile.", + "keybind.language": "Lingua", + "keybind.help": "Aiuto", + "table.format_id": "ID formato", + "table.resolution": "Risoluzione", + "table.acodec": "Codec audio", + "table.vcodec": "Codec video", + "table.format": "Formato", + "error.empty_url": "Inserisci un URL.", + "error.empty_destination": "Inserisci un nome di destinazione.", + "error.nothing_selected": "Seleziona le parti prima del download.", + "error.no_formats": "Non sono stati trovati formati scaricabili per questo URL.", + "error.no_audio_selected": "Non è stata selezionata alcuna parte audio valida.", + "error.no_video_selected": "Non è stata selezionata alcuna parte video valida.", + "error.fetch_failed": "Impossibile leggere le informazioni del filmato:\n{error}", + "error.download_failed": "Download non riuscito:\n{error}", + "error.merge_failed": "Unione di audio e video non riuscita:\n{error}" +} diff --git a/main.py b/main.py index 54e803b..1ab40b4 100644 --- a/main.py +++ b/main.py @@ -34,7 +34,11 @@ from i18n import I18n # noqa: E402 (import must follow sys.path setup) DEFAULT_LANGUAGE = "en" AVAILABLE_LANGUAGES = { "en": "English", + "da": "Dansk", "de": "Deutsch", + "es": "Español", + "fr": "Français", + "it": "Italiano", }