Lyrics Translation and Romaji (Fulfill #732) [Translation Part] (#747)

This commit is contained in:
Xudong Zhou 2024-09-24 11:25:17 +08:00 committed by GitHub
parent e3946a9413
commit 31492fa9ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 243 additions and 46 deletions

View file

@ -19,6 +19,7 @@ interface LyricsActionsProps {
onRemoveLyric: () => void;
onResetLyric: () => void;
onSearchOverride: (params: LyricsOverride) => void;
onTranslateLyric: () => void;
setIndex: (idx: number) => void;
}
@ -28,6 +29,7 @@ export const LyricsActions = ({
onRemoveLyric,
onResetLyric,
onSearchOverride,
onTranslateLyric,
setIndex,
}: LyricsActionsProps) => {
const { t } = useTranslation();
@ -120,7 +122,6 @@ export const LyricsActions = ({
{isDesktop && sources.length ? (
<Button
uppercase
color="red"
disabled={isActionsDisabled}
variant="subtle"
onClick={onRemoveLyric}
@ -129,6 +130,19 @@ export const LyricsActions = ({
</Button>
) : null}
</Box>
<Box style={{ position: 'absolute', right: 0, top: -50 }}>
{isDesktop && sources.length ? (
<Button
uppercase
disabled={isActionsDisabled}
variant="subtle"
onClick={onTranslateLyric}
>
{t('common.translation', { postProcess: 'sentenceCase' })}
</Button>
) : null}
</Box>
</Box>
);
};