Skip to content

Commit

Permalink
Merge pull request #121 from okisdev/feat/shortcut-to-close-window
Browse files Browse the repository at this point in the history
feat: shortcut to close window
  • Loading branch information
Sherlockouo authored Feb 19, 2024
2 parents 52ff0b0 + 783a00b commit 15ee92d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 36 deletions.
13 changes: 12 additions & 1 deletion packages/desktop/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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: [
Expand Down
35 changes: 18 additions & 17 deletions packages/web/i18n/locales/en-us.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"common": {
"recent":"Recent",
"recent": "Recent",
"artist_one": "Artist",
"daily": "Daily",
"artist_other": "Artists",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
37 changes: 19 additions & 18 deletions packages/web/i18n/locales/zh-cn.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"common": {
"recent":"最近播放",
"recent": "最近播放",
"album_one": "专辑",
"album_other": "专辑",
"daily": "日推",
Expand All @@ -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": "返回",
Expand Down Expand Up @@ -86,8 +87,8 @@
"show-lyric-background-img": "显示背景图片",
"general": "通用",
"lab": {
"title":"实验室",
"description":"这里可能有一些测试功能"
"title": "实验室",
"description": "这里可能有一些测试功能"
},
"unlock": "解锁更多歌源",
"engine": "引擎",
Expand All @@ -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": "快捷键",
Expand Down Expand Up @@ -158,4 +159,4 @@
"songs": "首歌曲",
"plays": "次播放"
}
}
}

0 comments on commit 15ee92d

Please sign in to comment.