mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-08 11:40:03 +02:00
Use proper casing for i18n locales (#1998)
This commit is contained in:
@@ -85,7 +85,6 @@ ${contents}
|
||||
data-autofocus
|
||||
label={t('form.lyricsExport.input', {
|
||||
context: 'synced',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('synced', { type: 'checkbox' })}
|
||||
/>
|
||||
@@ -93,7 +92,6 @@ ${contents}
|
||||
data-autofocus
|
||||
label={t('form.lyricsExport.input', {
|
||||
context: 'offset',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('offsetMs')}
|
||||
/>
|
||||
@@ -104,10 +102,10 @@ ${contents}
|
||||
<Divider />
|
||||
<Group justify="flex-end">
|
||||
<Button onClick={() => closeAllModals()} variant="default">
|
||||
{t('common.close', { postProcess: 'titleCase' })}
|
||||
{t('common.close')}
|
||||
</Button>
|
||||
<Button onClick={exportLyrics} variant="filled">
|
||||
{t('form.lyricsExport.export', { postProcess: 'titleCase' })}
|
||||
{t('form.lyricsExport.export')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
@@ -123,6 +121,6 @@ export const openLyricsExportModal = ({ lyrics, offsetMs, synced }: LyricsExport
|
||||
height: '600px',
|
||||
},
|
||||
},
|
||||
title: i18n.t('form.lyricSearch.title', { postProcess: 'titleCase' }) as string,
|
||||
title: i18n.t('form.lyricSearch.title') as string,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -57,17 +57,13 @@ const SearchResult = ({ data, isSelected, onClick }: SearchResultProps) => {
|
||||
|
||||
const syncStatus = useMemo(() => {
|
||||
if (isSync === true) {
|
||||
return t('page.fullscreenPlayer.config.synchronized', {
|
||||
postProcess: 'sentenceCase',
|
||||
});
|
||||
return t('page.fullscreenPlayer.config.synchronized');
|
||||
}
|
||||
if (isSync === false) {
|
||||
return t('page.fullscreenPlayer.config.unsynchronized', {
|
||||
postProcess: 'sentenceCase',
|
||||
});
|
||||
return t('page.fullscreenPlayer.config.unsynchronized');
|
||||
}
|
||||
|
||||
return t('common.unknown', { postProcess: 'titleCase' });
|
||||
return t('common.unknown');
|
||||
}, [isSync, t]);
|
||||
|
||||
return (
|
||||
@@ -186,7 +182,6 @@ export const LyricsSearchForm = ({ artist, name, onSearchOverride }: LyricSearch
|
||||
data-autofocus
|
||||
label={t('form.lyricSearch.input', {
|
||||
context: 'name',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
rightSection={
|
||||
form.values.name ? (
|
||||
@@ -203,7 +198,6 @@ export const LyricsSearchForm = ({ artist, name, onSearchOverride }: LyricSearch
|
||||
<TextInput
|
||||
label={t('form.lyricSearch.input', {
|
||||
context: 'artist',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
rightSection={
|
||||
form.values.artist ? (
|
||||
@@ -288,11 +282,7 @@ export const LyricsSearchForm = ({ artist, name, onSearchOverride }: LyricSearch
|
||||
</div>
|
||||
) : (
|
||||
<Center>
|
||||
<Text isMuted>
|
||||
{t('page.fullscreenPlayer.noLyrics', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
</Text>
|
||||
<Text isMuted>{t('page.fullscreenPlayer.noLyrics')}</Text>
|
||||
</Center>
|
||||
)}
|
||||
</ScrollArea>
|
||||
@@ -302,17 +292,17 @@ export const LyricsSearchForm = ({ artist, name, onSearchOverride }: LyricSearch
|
||||
<Divider />
|
||||
<Group justify="flex-end">
|
||||
<Button onClick={() => closeAllModals()} variant="default">
|
||||
{t('common.cancel', { postProcess: 'titleCase' })}
|
||||
{t('common.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={!selectedResult || !previewData}
|
||||
onClick={handleExport}
|
||||
variant="default"
|
||||
>
|
||||
{t('form.lyricsExport.export', { postProcess: 'titleCase' })}
|
||||
{t('form.lyricsExport.export')}
|
||||
</Button>
|
||||
<Button disabled={!selectedResult} onClick={handleApply} variant="filled">
|
||||
{t('common.confirm', { postProcess: 'titleCase' })}
|
||||
{t('common.confirm')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
@@ -330,6 +320,6 @@ export const openLyricSearchModal = ({ artist, name, onSearchOverride }: LyricSe
|
||||
height: '600px',
|
||||
},
|
||||
},
|
||||
title: i18n.t('form.lyricSearch.title', { postProcess: 'titleCase' }) as string,
|
||||
title: i18n.t('form.lyricSearch.title') as string,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -79,7 +79,6 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
description: '',
|
||||
title: t(
|
||||
`${t('page.fullscreenPlayer.config.lyricSize')} (${t('page.fullscreenPlayer.config.synchronized')})`,
|
||||
{ postProcess: 'sentenceCase' },
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -102,7 +101,6 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
description: '',
|
||||
title: t(
|
||||
`${t('page.fullscreenPlayer.config.lyricSize')} (${t('page.fullscreenPlayer.config.unsynchronized')})`,
|
||||
{ postProcess: 'sentenceCase' },
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -125,7 +123,6 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
description: '',
|
||||
title: t(
|
||||
`${t('page.fullscreenPlayer.config.lyricGap')} (${t('page.fullscreenPlayer.config.synchronized')})`,
|
||||
{ postProcess: 'sentenceCase' },
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -148,19 +145,18 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
description: '',
|
||||
title: t(
|
||||
`${t('page.fullscreenPlayer.config.lyricGap')} (${t('page.fullscreenPlayer.config.unsynchronized')})`,
|
||||
{ postProcess: 'sentenceCase' },
|
||||
),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{ label: t('common.left', { postProcess: 'titleCase' }), value: 'left' },
|
||||
{ label: t('common.left'), value: 'left' },
|
||||
{
|
||||
label: t('common.center', { postProcess: 'titleCase' }),
|
||||
label: t('common.center'),
|
||||
value: 'center',
|
||||
},
|
||||
{ label: t('common.right', { postProcess: 'titleCase' }), value: 'right' },
|
||||
{ label: t('common.right'), value: 'right' },
|
||||
]}
|
||||
onChange={(value) =>
|
||||
updateLyricsSetting({ alignment: value as 'center' | 'left' | 'right' })
|
||||
@@ -169,9 +165,7 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t('page.fullscreenPlayer.config.lyricAlignment', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('page.fullscreenPlayer.config.lyricAlignment'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -182,9 +176,7 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t('page.fullscreenPlayer.config.followCurrentLyric', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('page.fullscreenPlayer.config.followCurrentLyric'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -203,9 +195,7 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t(`${t('page.fullscreenPlayer.config.lyricOpacityNonActive')}`, {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t(`${t('page.fullscreenPlayer.config.lyricOpacityNonActive')}`, {}),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -224,9 +214,7 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t(`${t('page.fullscreenPlayer.config.lyricScaleNonActive')}`, {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t(`${t('page.fullscreenPlayer.config.lyricScaleNonActive')}`, {}),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -237,9 +225,7 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t('page.fullscreenPlayer.config.showLyricMatch', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('page.fullscreenPlayer.config.showLyricMatch'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -250,9 +236,7 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t('page.fullscreenPlayer.config.showLyricProvider', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('page.fullscreenPlayer.config.showLyricProvider'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -269,10 +253,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.preferLocalLyrics', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.preferLocalLyrics', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.preferLocalLyrics'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -284,10 +267,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.lyricFetch', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricFetch', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lyricFetch'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -305,10 +287,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.lyricFetchProvider', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricFetchProvider', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lyricFetchProvider'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -324,10 +305,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.neteaseTranslation', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.neteaseTranslation', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.neteaseTranslation'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -343,10 +323,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.lyricOffset', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricOffset', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lyricOffset'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -360,10 +339,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.translationTargetLanguage', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.translationTargetLanguage', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.translationTargetLanguage'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -378,10 +356,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.translationApiProvider', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.translationApiProvider', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.translationApiProvider'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -394,10 +371,9 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.translationApiKey', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.translationApiKey', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.translationApiKey'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -411,19 +387,18 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
),
|
||||
description: t('setting.enableAutoTranslation', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.enableAutoTranslation', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.enableAutoTranslation'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Stack gap="md" p="md">
|
||||
<Fieldset legend={t('page.setting.lyricsDisplay', { postProcess: 'sentenceCase' })}>
|
||||
<Fieldset legend={t('page.setting.lyricsDisplay')}>
|
||||
<SettingsSection options={displayOptions} />
|
||||
</Fieldset>
|
||||
<Fieldset legend={t('page.setting.lyrics', { postProcess: 'sentenceCase' })}>
|
||||
<Fieldset legend={t('page.setting.lyrics')}>
|
||||
<SettingsSection options={lyricOptions} />
|
||||
</Fieldset>
|
||||
</Stack>
|
||||
|
||||
@@ -70,7 +70,7 @@ export const LyricsActions = ({
|
||||
uppercase
|
||||
variant="subtle"
|
||||
>
|
||||
{t('form.lyricsExport.export', { postProcess: 'sentenceCase ' })}
|
||||
{t('form.lyricsExport.export')}
|
||||
</Button>
|
||||
</Center>
|
||||
)}
|
||||
@@ -89,7 +89,7 @@ export const LyricsActions = ({
|
||||
uppercase
|
||||
variant="subtle"
|
||||
>
|
||||
{t('common.search', { postProcess: 'titleCase' })}
|
||||
{t('common.search')}
|
||||
</Button>
|
||||
) : null}
|
||||
<ActionIcon
|
||||
@@ -97,15 +97,12 @@ export const LyricsActions = ({
|
||||
icon="minus"
|
||||
onClick={() => handleLyricOffset(offsetMs - 50)}
|
||||
tooltip={{
|
||||
label: t('common.slower', { postProcess: 'sentenceCase' }),
|
||||
label: t('common.slower'),
|
||||
openDelay: 0,
|
||||
}}
|
||||
variant="subtle"
|
||||
/>
|
||||
<Tooltip
|
||||
label={t('setting.lyricOffset', { postProcess: 'sentenceCase' })}
|
||||
openDelay={0}
|
||||
>
|
||||
<Tooltip label={t('setting.lyricOffset')} openDelay={0}>
|
||||
<NumberInput
|
||||
aria-label="Lyric offset"
|
||||
onChange={handleLyricOffset}
|
||||
@@ -119,7 +116,7 @@ export const LyricsActions = ({
|
||||
icon="plus"
|
||||
onClick={() => handleLyricOffset(offsetMs + 50)}
|
||||
tooltip={{
|
||||
label: t('common.faster', { postProcess: 'sentenceCase' }),
|
||||
label: t('common.faster'),
|
||||
openDelay: 0,
|
||||
}}
|
||||
variant="subtle"
|
||||
@@ -131,9 +128,7 @@ export const LyricsActions = ({
|
||||
uppercase
|
||||
variant="subtle"
|
||||
>
|
||||
{hasLyrics
|
||||
? t('common.clear', { postProcess: 'sentenceCase' })
|
||||
: t('common.refresh', { postProcess: 'sentenceCase' })}
|
||||
{hasLyrics ? t('common.clear') : t('common.refresh')}
|
||||
</Button>
|
||||
) : null}
|
||||
</Group>
|
||||
@@ -146,7 +141,7 @@ export const LyricsActions = ({
|
||||
uppercase
|
||||
variant="subtle"
|
||||
>
|
||||
{t('common.translation', { postProcess: 'sentenceCase' })}
|
||||
{t('common.translation')}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -318,9 +318,7 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
||||
>
|
||||
<Group>
|
||||
<Text fw={500} isMuted isNoSelect>
|
||||
{t('page.fullscreenPlayer.noLyrics', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
{t('page.fullscreenPlayer.noLyrics')}
|
||||
</Text>
|
||||
</Group>
|
||||
</motion.div>
|
||||
|
||||
@@ -19,7 +19,7 @@ export const openLyricsSettingsModal = (settingsKey: string = 'default') => {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
title: i18n.t('common.setting', { count: 2, postProcess: 'titleCase' }),
|
||||
title: i18n.t('common.setting', { count: 2 }),
|
||||
transitionProps: {
|
||||
transition: 'pop',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user