mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
fix: i18n for default menu
This commit is contained in:
@ -542,7 +542,15 @@
|
||||
}
|
||||
},
|
||||
"view": {
|
||||
"label": "View"
|
||||
"label": "View",
|
||||
"submenu": {
|
||||
"reload": "Reload",
|
||||
"force-reload": "Force Reload",
|
||||
"toggle-fullscreen": "Toggle Full Screen",
|
||||
"reset-zoom": "Actual Size",
|
||||
"zoom-in": "Zoom In",
|
||||
"zoom-out": "Zoom Out"
|
||||
}
|
||||
},
|
||||
"navigation": {
|
||||
"label": "Navigation",
|
||||
@ -550,10 +558,19 @@
|
||||
"go-back": "Go back",
|
||||
"go-forward": "Go forward",
|
||||
"copy-current-url": "Copy current URL",
|
||||
"restart": "Restart App"
|
||||
"restart": "Restart App",
|
||||
"quit": "Exit2"
|
||||
}
|
||||
},
|
||||
"about": "About"
|
||||
},
|
||||
"tray": {
|
||||
"play-pause": "Play/Pause",
|
||||
"next": "Next",
|
||||
"previous": "Previous",
|
||||
"show": "Show",
|
||||
"restart": "Restart App",
|
||||
"quit": "Quit"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
|
||||
34
src/menu.ts
34
src/menu.ts
@ -1,3 +1,5 @@
|
||||
import process from 'node:process';
|
||||
|
||||
import is from 'electron-is';
|
||||
import {
|
||||
app,
|
||||
@ -410,7 +412,10 @@ export const mainMenuTemplate = async (
|
||||
}
|
||||
},
|
||||
}
|
||||
: { role: 'toggleDevTools' },
|
||||
: {
|
||||
label: t('main.menu.options.submenu.advanced-options.submenu.toggle-dev-tools'),
|
||||
role: 'toggleDevTools'
|
||||
},
|
||||
{
|
||||
label: t('main.menu.options.submenu.advanced-options.submenu.edit-config-json'),
|
||||
click() {
|
||||
@ -424,20 +429,34 @@ export const mainMenuTemplate = async (
|
||||
{
|
||||
label: t('main.menu.view.label'),
|
||||
submenu: [
|
||||
{ role: 'reload' },
|
||||
{ role: 'forceReload' },
|
||||
{
|
||||
label: t('main.menu.view.submenu.reload'),
|
||||
role: 'reload',
|
||||
},
|
||||
{
|
||||
label: t('main.menu.view.submenu.force-reload'),
|
||||
role: 'forceReload',
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: t('main.menu.view.submenu.zoom-in'),
|
||||
role: 'zoomIn',
|
||||
accelerator: process.platform === 'darwin' ? 'Cmd+I' : 'Ctrl+I',
|
||||
},
|
||||
{
|
||||
label: t('main.menu.view.submenu.zoom-out'),
|
||||
role: 'zoomOut',
|
||||
accelerator: process.platform === 'darwin' ? 'Cmd+O' : 'Ctrl+O',
|
||||
},
|
||||
{ role: 'resetZoom' },
|
||||
{
|
||||
label: t('main.menu.view.submenu.reset-zoom'),
|
||||
role: 'resetZoom',
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{ role: 'togglefullscreen' },
|
||||
{
|
||||
label: t('main.menu.view.submenu.toggle-fullscreen'),
|
||||
role: 'togglefullscreen',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -470,7 +489,10 @@ export const mainMenuTemplate = async (
|
||||
label: t('main.menu.navigation.submenu.restart'),
|
||||
click: restart,
|
||||
},
|
||||
{ role: 'quit' },
|
||||
{
|
||||
label: t('main.menu.navigation.submenu.quit'),
|
||||
role: 'quit',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
17
src/tray.ts
17
src/tray.ts
@ -7,6 +7,8 @@ import config from './config';
|
||||
import { restart } from './providers/app-controls';
|
||||
import getSongControls from './providers/song-controls';
|
||||
|
||||
import { t } from '@/i18n';
|
||||
|
||||
import type { MenuTemplate } from './menu';
|
||||
|
||||
// Prevent tray being garbage collected
|
||||
@ -70,35 +72,38 @@ export const setUpTray = (app: Electron.App, win: Electron.BrowserWindow) => {
|
||||
|
||||
const template: MenuTemplate = [
|
||||
{
|
||||
label: 'Play/Pause',
|
||||
label: t('main.tray.play-pause'),
|
||||
click() {
|
||||
playPause();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Next',
|
||||
label: t('main.tray.next'),
|
||||
click() {
|
||||
next();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Previous',
|
||||
label: t('main.tray.previous'),
|
||||
click() {
|
||||
previous();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Show',
|
||||
label: t('main.tray.show'),
|
||||
click() {
|
||||
win.show();
|
||||
app.dock?.show();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Restart App',
|
||||
label: t('main.tray.restart'),
|
||||
click: restart,
|
||||
},
|
||||
{ role: 'quit' },
|
||||
{
|
||||
label: t('main.tray.quit'),
|
||||
role: 'quit',
|
||||
},
|
||||
];
|
||||
|
||||
const trayMenu = Menu.buildFromTemplate(template);
|
||||
|
||||
Reference in New Issue
Block a user