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:
@ -1,3 +1,5 @@
|
||||
import process from 'node:process';
|
||||
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
import is from 'electron-is';
|
||||
|
||||
@ -8,8 +10,12 @@ import {
|
||||
forceUnloadPreloadPlugin,
|
||||
loadAllPreloadPlugins,
|
||||
} from './loader/preload';
|
||||
import { loadI18n, setLanguage } from '@/i18n';
|
||||
|
||||
loadAllPreloadPlugins();
|
||||
loadI18n().then(async () => {
|
||||
await setLanguage(config.get('options.language') ?? 'en');
|
||||
loadAllPreloadPlugins();
|
||||
});
|
||||
|
||||
ipcRenderer.on('plugin:unload', async (_, id: string) => {
|
||||
await forceUnloadPreloadPlugin(id);
|
||||
|
||||
Reference in New Issue
Block a user