diff --git a/src/i18n/resources/en.json b/src/i18n/resources/en.json index 0e64ff30..8a8bcf5c 100644 --- a/src/i18n/resources/en.json +++ b/src/i18n/resources/en.json @@ -381,6 +381,7 @@ }, "description": "Downloads MP3 / source audio directly from the interface", "menu": { + "download-playlist": "Download playlist", "choose-download-folder": "Choose download folder", "presets": "Presets", "skip-existing": "Skip existing files" diff --git a/src/plugins/downloader/index.ts b/src/plugins/downloader/index.ts index b2cf1108..bad69122 100644 --- a/src/plugins/downloader/index.ts +++ b/src/plugins/downloader/index.ts @@ -5,6 +5,7 @@ import style from './style.css?inline'; import { createPlugin } from '@/utils'; import { onConfigChange, onMainLoad } from './main'; import { onPlayerApiReady, onRendererLoad } from './renderer'; +import { onMenu } from './menu'; import { t } from '@/i18n'; export type DownloaderPluginConfig = { @@ -31,6 +32,7 @@ export default createPlugin({ restartNeeded: true, config: defaultConfig, stylesheets: [style], + menu: onMenu, backend: { start: onMainLoad, onConfigChange, diff --git a/src/plugins/downloader/main/utils.ts b/src/plugins/downloader/main/utils.ts index 6fced15a..10ecbfde 100644 --- a/src/plugins/downloader/main/utils.ts +++ b/src/plugins/downloader/main/utils.ts @@ -3,7 +3,6 @@ import is from 'electron-is'; export const getFolder = (customFolder: string) => customFolder || app.getPath('downloads'); -export const defaultMenuDownloadLabel = 'Download playlist'; export const sendFeedback = (win: BrowserWindow, message?: unknown) => { win.webContents.send('downloader-feedback', message); diff --git a/src/plugins/downloader/menu.ts b/src/plugins/downloader/menu.ts index ef94f5a5..995e7d8f 100644 --- a/src/plugins/downloader/menu.ts +++ b/src/plugins/downloader/menu.ts @@ -1,7 +1,7 @@ import { dialog } from 'electron'; import { downloadPlaylist } from './main'; -import { defaultMenuDownloadLabel, getFolder } from './main/utils'; +import { getFolder } from './main/utils'; import { DefaultPresetList } from './types'; import { t } from '@/i18n'; @@ -19,7 +19,7 @@ export const onMenu = async ({ return [ { - label: defaultMenuDownloadLabel, + label: t('plugins.downloader.menu.download-playlist'), click: () => downloadPlaylist(), }, {