diff --git a/packages/desktop/main/menu.ts b/packages/desktop/main/menu.ts index 48595a2..7f191aa 100644 --- a/packages/desktop/main/menu.ts +++ b/packages/desktop/main/menu.ts @@ -5,6 +5,7 @@ import { exec } from 'child_process' import log from './log' import { IpcChannels } from '@/shared/IpcChannels' import { formatForAccelerator, readKeyboardShortcuts } from './keyboardShortcuts' +import { t } from 'i18next' log.info('[electron] menu.ts') @@ -86,7 +87,17 @@ export const createMenu = (webContexts: WebContents, isBindingShortcuts: boolean { role: 'editMenu' }, { role: 'viewMenu' }, controlsMenuItem as any, - { role: 'windowMenu' }, + { + role: 'windowMenu', + submenu: [ + // close window shortcut for all platforms + { + label: t`common.close-window`, + accelerator: 'CmdOrCtrl+W', + role: 'close', + }, + ], + }, { label: '帮助', submenu: [ diff --git a/packages/web/i18n/locales/en-us.json b/packages/web/i18n/locales/en-us.json index 7d8663c..b6bca48 100644 --- a/packages/web/i18n/locales/en-us.json +++ b/packages/web/i18n/locales/en-us.json @@ -1,6 +1,6 @@ { "common": { - "recent":"Recent", + "recent": "Recent", "artist_one": "Artist", "daily": "Daily", "artist_other": "Artists", @@ -18,14 +18,15 @@ "video_other": "Videos", "video-with-count_one": "{{count}} Video", "video-with-count_other": "{{count}} Videos", - "lyricsBlur":"Lyrics Blur Effect", - "cloud":"cloud", - "upload":"upload music", - "showSongFrequency":"Show song frequency", - "showSongFrequencyWarnning":"⚠️This is performance consuming", - "showDeskttopLyrics":"Show Deskttop Lyrics", - "showDevices":"Show Audio Devices", - "hide-show-player": "Hide/Show Player" + "lyricsBlur": "Lyrics Blur Effect", + "cloud": "cloud", + "upload": "upload music", + "showSongFrequency": "Show song frequency", + "showSongFrequencyWarnning": "⚠️This is performance consuming", + "showDeskttopLyrics": "Show Deskttop Lyrics", + "showDevices": "Show Audio Devices", + "hide-show-player": "Hide/Show Player", + "close-window": "Close Window" }, "navigation": { "goBack": "Go back", @@ -86,8 +87,8 @@ "lyric-style": "Background Image", "show-lyric-background-img": "Show Backround Image", "lab": { - "title":"Lab", - "description":"There are some experimental functions" + "title": "Lab", + "description": "There are some experimental functions" }, "unlock": "Unlock More Music Source", "engine": "Engine", @@ -104,12 +105,12 @@ "player-find-alternative-track-on-youtube-if-not-available-on-netease": "Find alternative track on YouTube if not available on NetEase.", "volume-control": "Volume Control", "about": "About", - "host":"Proxy", - "qqCookie":"QQ_COOKIE", - "cookieSettingRefrence":"Click here for the configuration instruction. ", - "cookieDesc":"Leave empty to pick up the default value", - "miguCookie":"MIGU_COOKIE", - "jooxCookie":"JOOX_COOKIE", + "host": "Proxy", + "qqCookie": "QQ_COOKIE", + "cookieSettingRefrence": "Click here for the configuration instruction. ", + "cookieDesc": "Leave empty to pick up the default value", + "miguCookie": "MIGU_COOKIE", + "jooxCookie": "JOOX_COOKIE", "show-track-list-name": "Show Track List Name in Browse", "keyboard-shortcuts": { "title": "Keyboard Shortcuts", diff --git a/packages/web/i18n/locales/zh-cn.json b/packages/web/i18n/locales/zh-cn.json index 712c595..ddf6f46 100644 --- a/packages/web/i18n/locales/zh-cn.json +++ b/packages/web/i18n/locales/zh-cn.json @@ -1,6 +1,6 @@ { "common": { - "recent":"最近播放", + "recent": "最近播放", "album_one": "专辑", "album_other": "专辑", "daily": "日推", @@ -18,14 +18,15 @@ "video_other": "视频", "video-with-count_one": "{{count}} 个视频", "video-with-count_other": "{{count}} 个视频", - "lyricsBlur":"歌词模糊效果", - "cloud":"云盘", - "upload":"上传歌曲", - "showSongFrequency":"展示歌曲频谱图", - "showSongFrequencyWarnning":"⚠️此功能非常消耗性能", - "showDeskttopLyrics":"展示桌面歌词", - "showDevices":"展示音频播放设备", - "hide-show-player": "隐藏/显示播放器" + "lyricsBlur": "歌词模糊效果", + "cloud": "云盘", + "upload": "上传歌曲", + "showSongFrequency": "展示歌曲频谱图", + "showSongFrequencyWarnning": "⚠️此功能非常消耗性能", + "showDeskttopLyrics": "展示桌面歌词", + "showDevices": "展示音频播放设备", + "hide-show-player": "隐藏/显示播放器", + "close-window": "关闭窗口" }, "navigation": { "goBack": "返回", @@ -86,8 +87,8 @@ "show-lyric-background-img": "显示背景图片", "general": "通用", "lab": { - "title":"实验室", - "description":"这里可能有一些测试功能" + "title": "实验室", + "description": "这里可能有一些测试功能" }, "unlock": "解锁更多歌源", "engine": "引擎", @@ -104,12 +105,12 @@ "player-youtube-unlock": "YouTube 解锁", "volume-control": "音量控制", "about": "关于", - "proxy":"代理", - "qqCookie":"QQ_COOKIE", - "miguCookie":"MIGU_COOKIE", - "cookieSettingRefrence":"设置说明请参见此处", - "cookieDesc":",留空则不进行相关设置", - "jooxCookie":"JOOX_COOKIE", + "proxy": "代理", + "qqCookie": "QQ_COOKIE", + "miguCookie": "MIGU_COOKIE", + "cookieSettingRefrence": "设置说明请参见此处", + "cookieDesc": ",留空则不进行相关设置", + "jooxCookie": "JOOX_COOKIE", "show-track-list-name": "在 Browse 页面显示歌单名称", "keyboard-shortcuts": { "title": "快捷键", @@ -158,4 +159,4 @@ "songs": "首歌曲", "plays": "次播放" } -} +} \ No newline at end of file