Fix Lyric Translation Not Resetting (#1208)

* Refactor lyrics translation and index handling

* Add auto translation toggle to lyric settings

* Add enableAutoTranslation setting to lyrics
This commit is contained in:
Xudong Zhou
2025-11-01 08:08:10 +08:00
committed by GitHub
parent d12e4a1635
commit dd34888961
4 changed files with 51 additions and 18 deletions
@@ -214,6 +214,28 @@ export const LyricSettings = () => {
isHidden: !isElectron(),
title: t('setting.translationApiKey', { postProcess: 'sentenceCase' }),
},
{
control: (
<Switch
aria-label="Enable auto translation"
defaultChecked={settings.enableAutoTranslation}
onChange={(e) => {
setSettings({
lyrics: {
...settings,
enableAutoTranslation: e.currentTarget.checked,
},
});
}}
/>
),
description: t('setting.enableAutoTranslation', {
context: 'description',
postProcess: 'sentenceCase',
}),
isHidden: !isElectron(),
title: t('setting.enableAutoTranslation', { postProcess: 'sentenceCase' }),
},
];
return <SettingsSection divider={false} options={lyricOptions} />;