mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 11:01:45 +00:00
feat: add support i18n (#1468)
This commit is contained in:
@ -3,14 +3,15 @@ import { createPlugin } from '@/utils';
|
||||
import { onMainLoad } from './main';
|
||||
import { onMenu } from './menu';
|
||||
import { onPlayerApiReady, onRendererLoad } from './renderer';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
export interface InAppMenuConfig {
|
||||
enabled: boolean;
|
||||
hideDOMWindowControls: boolean;
|
||||
}
|
||||
export default createPlugin({
|
||||
name: 'In-App Menu',
|
||||
description: 'gives menu-bars a fancy, dark or album-color look',
|
||||
name: t('plugins.in-app-menu.name'),
|
||||
description: t('plugins.in-app-menu.description'),
|
||||
restartNeeded: true,
|
||||
config: {
|
||||
enabled:
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import is from 'electron-is';
|
||||
|
||||
import { t } from '@/i18n';
|
||||
|
||||
import type { InAppMenuConfig } from './index';
|
||||
import type { MenuContext } from '@/types/contexts';
|
||||
import type { MenuTemplate } from '@/menu';
|
||||
@ -13,7 +15,7 @@ export const onMenu = async ({
|
||||
if (is.linux()) {
|
||||
return [
|
||||
{
|
||||
label: 'Hide DOM Window Controls',
|
||||
label: t('plugins.in-app-menu.hide-dom-window-controls'),
|
||||
type: 'checkbox',
|
||||
checked: config.hideDOMWindowControls,
|
||||
click(item) {
|
||||
|
||||
@ -99,7 +99,7 @@ export const createPanel = (
|
||||
children.push(...children);
|
||||
}
|
||||
|
||||
panel.appendChild(menu);
|
||||
return panel.appendChild(menu);
|
||||
});
|
||||
|
||||
/* methods */
|
||||
|
||||
Reference in New Issue
Block a user