mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 19:01:47 +00:00
feat: add support i18n (#1468)
This commit is contained in:
@ -2,6 +2,7 @@ import style from './style.css?inline';
|
||||
import { createPlugin } from '@/utils';
|
||||
import { onConfigChange, onMainLoad } from './main';
|
||||
import { onRendererLoad } from './renderer';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
export type LyricsGeniusPluginConfig = {
|
||||
enabled: boolean;
|
||||
@ -9,8 +10,8 @@ export type LyricsGeniusPluginConfig = {
|
||||
};
|
||||
|
||||
export default createPlugin({
|
||||
name: 'Lyrics Genius',
|
||||
description: 'Adds lyrics support for most songs',
|
||||
name: t('plugins.lyrics-genius.name'),
|
||||
description: t('plugins.lyrics-genius.description'),
|
||||
restartNeeded: true,
|
||||
config: {
|
||||
enabled: false,
|
||||
@ -22,7 +23,7 @@ export default createPlugin({
|
||||
|
||||
return [
|
||||
{
|
||||
label: 'Romanized Lyrics',
|
||||
label: t('plugins.lyrics-genius.menu.romanized-lyrics'),
|
||||
type: 'checkbox',
|
||||
checked: config.romanizedLyrics,
|
||||
click(item) {
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import { LoggerPrefix } from '@/utils';
|
||||
|
||||
import type { SongInfo } from '@/providers/song-info';
|
||||
import type { RendererContext } from '@/types/contexts';
|
||||
import type { LyricsGeniusPluginConfig } from '@/plugins/lyrics-genius/index';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
export const onRendererLoad = ({
|
||||
ipc: { invoke, on },
|
||||
@ -55,7 +58,10 @@ export const onRendererLoad = ({
|
||||
}
|
||||
|
||||
if (window.electronIs.dev()) {
|
||||
console.log('Fetched lyrics from Genius');
|
||||
console.log(
|
||||
LoggerPrefix,
|
||||
t('plugins.lyric-genius.renderer.fetched-lyrics'),
|
||||
);
|
||||
}
|
||||
|
||||
const tryToInjectLyric = (callback?: () => void) => {
|
||||
|
||||
Reference in New Issue
Block a user